With 155 of 156 constituencies reporting, official results on Monday showed Hichilema had secured 2,810,757 votes against Lungu’s 1,814,201.
The significant win sparked celebrations on the streets after an election marred by sporadic violence.
Hichilema, a former chief executive officer at an accounting firm before he entered politics, faces a daunting task turning around the economic fortunes of one of the world’s poorest countries.
Al Jazeera’s Haru Mutasa, reporting from the capital Lusaka, said many of the voters were young people.
The election marked the sixth time Hichilema had run for the top job and the third time he had challenged 64-year-old incumbent Lungu.
In 2016, he narrowly lost to Lungu by about 100,000 votes.
Lungu, who has been in office for six years, faced the electorate amid growing resentment about the rising cost of living and crackdowns on dissent in the southern African country.
Hichilema enjoyed the backing of 10 opposition parties at Thursday’s vote under the banner of his United Party for National Development (UPND), the largest opposition in Zambia.
Lungu began crying foul before a winner was declared, claiming the election was neither free nor fair due to incidents of violence reported in what are traditionally Hichilema’s stronghold.
In a statement issued through the president’s office, he alleged that his party’s polling agents were attacked and chased from voting stations.
Officials from Hichilema’s UPND party dismissed Lungu’s statement as emanating from people “trying to throw out the entire election just to cling on to their jobs”.
In terms of the law, if Lungu wants to settle a dispute or nullify elections, he must approach the Constitutional Court within seven days to lodge a complaint after a winner is announced.
International election observers have commended the transparent and peaceful organisation of the polls, but condemned the restrictions on freedom of assembly and movement during the election campaign.
Security forces blocked Hichilema from campaigning in several areas citing breaches of coronavirus measures and a public order act.
Turnout at the polls was estimated at just more than 70 percent.