The opposition candidate in the Zambian presidential elections, Michael Sata of the Patriotic Front, has been declared the winner, beating the governing party which has spent 20 years in power.
With 95% of the vote counted, the electoral commission says the incumbent president, Rupiah Banda, of the Movement for Multi-party Democracy, cannot catch up.
The election had been marred by riots in Zambia's northern mining region.
The anger had been prompted by a ban on the media announcing results not verified by the electoral commission. The electoral commission said it had taken the step after its website was hacked to falsely record a landslide for 74-year-old Mr Sata.
Mr Sata becomes president on his fourth try. He lost in 2008, by just 35,000 votes which sparked rioting by some opposition supporters in the party's urban strongholds.
However, they were in jubilant mood after the victory announcement early on Friday morning.
Mr Sata has had a lengthy career in politics. He served as an MMD minister for local government, labour and social security, and health before quitting in 2001.
Known as King Cobra for his venomous tongue, foreign mining firms - often from China - have frequently been the target of his criticism about labour conditions.
While the party has disputed media reports it is anti-Chinese, it is likely to shake up the way contracts are awarded, the BBCs reports.
There were suggestions Chinese firms were bankrolling Mr Banda's re-election bid in the run-up to the poll, with PF candidates expressing surprise at the amount of funds available to the MMD.