With 155 of 156 constituencies reporting, official results showed Hichilema had garnered 2,810,757 votes against President Edgar Lungu's tally of 1,814,201.
Zambia's opposition leader Hichilema wins election after capturing more than 2.8 million votes
"I therefore declare the said Hakainde Hichilema to be president-elect of the Republic of Zambia," electoral commission chairman Justice Esau Chulu said in a televised address.
The 59-year-old veteran opposition politician beat his long-time rival Lungu following a bruising race held against the backdrop of deteriorating standards of living.
This is the sixth time Hichilema, who is 59, has run for the top job and the third time he has challenged 64-year-old incumbent Lungu.
In 2016, Hichilema narrowly lost to Lungu by around 100,000 votes.
Lungu, who has been in office for six years, faced the electorate amid growing resentment about rising living costs 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 and the largest opposition United Party for National Development (UPND).
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.
But even as results were still being tallied, street celebrations erupted in parts of the capital Lusaka with several hundred in party regalia waving flags and rallying outside Hichilema's house, AFP journalists saw. Others danced and honked car horns.
'Victory in sight'
Hichilema, popularly referred to by his initials 'HH' or as Bally (slang for dad), on Sunday called for peace.
"With victory in sight, I'd like to ask for calm from our members and supporters," he tweeted.
"We voted for change for a better Zambia that's free from violence and discrimination."
"Let us be the change we voted for and embrace the spirit of Ubuntu (humanity) to love and live together harmoniously."
He later tweeted an image of a silhouette of his raised hand superimposed on a background bearing the inscription "change is here".
Hichilema also tweeted a picture of himself and former president Rupiah Banda at the latter's residence, saying they had just concluded a meeting.
"We discussed a wide range of issues bordering on the welfare of our people. We remain committed to ensuring a united and prosperous Zambia for all," he wrote on Twitter.
Parties that backed Hichilema on Sunday scoffed at Lungu's "unsubstantiated" claims of a marred vote, and urged him to concede.
International election observers have commended the transparent and peaceful organisation of the polls, but condemned the restrictions on freedom of assembly and movement during campaigning.
Security forces blocked Hichilema from campaigning in several areas, including the strategic Copperbelt Province, citing breaches of coronavirus measures and a public order act.
Lungu also deployed the military following pre-election clashes and reinforced the army presence in three provinces after two deaths were reported on election day.
Social media access, restricted in the capital Lusaka just as Hichilema cast his vote, was restored on Saturday following a court order.
Turnout at the polls was estimated at just over 70 percent.