Nigeria's ruling party candidate Umaru Yar'Adua has won controversial presidential elections by a landslide, according to official results.
Security was tight as the results were announced
He gained 70% of the vote but European Union observers say the elections did not meet international standards and were not "credible".
The EU says at least 200 people have died since campaigning began.
The two main opposition candidates have told their supporters to reject the results and want a re-run.
Mr Yar'Adua gained 24.6m votes, against 6.6m for his closest challenger, Muhammadu Buhari.
Vice-president turned opposition candidate Atiku Abubakar came third with 2.6m votes.
Both men accuse the governing People's Democratic Party (PDP) of rigging the elections.
This should be the first time Africa's most populous nation replaces one elected civilian head with another.
"I felt greatly humbled by the events of today and this mandate," Mr Yar'Adua, 56, told state television.
Mr Buhari had earlier threatened to call his supporters onto the streets if Mr Yar'Adua was declared the winner and there was tight security outside the election commission headquarters in the capital, Abuja.
Independent National Election Commission (Inec) head Maurice Iwu refused to take any questions from the large crowd of journalists waiting for the results. He only read out the results.
Shortly before the announcement was made, outgoing President Olusegun Obasanjo made a surprise televised address to the nation.
He admitted that the poll had not been perfect but said the next elections would be better.
"It is my fervent wish that Nigerians will consider this experience as a necessary step in our journey as a people towards consolidating our democracy," he said.
Nigeria's biggest election monitoring group said the presidential poll was so flawed that it should be scrapped and held again.
"In many parts of the country elections did not start on time or did not start at all," said Transition Monitoring Group chief Innocent Chukwuma.
The US says it is "deeply troubled" by the weekend polls which it said were "flawed".
A spokesman at the State Department said Washington hoped the political parties would resolve any differences over the election through peaceful, constitutional means.
Voter Donaman Atezan, 25, told the BBC News website that election material was delivered late to his polling station in the central Benue Sate, after most people had gone home.
"Thugs were then left alone to vote and each one of them voted for the PDP over and over as many times as the ballot papers were available," he said.
He said he tried to vote for an opposition candidate but the ballot paper was ripped from his hand.
Officials had struggled to deliver some of the 60m ballot papers to stations in time for the vote. They only arrived in the country on Friday evening.
The boldest of several attempts to disrupt polling was in the hours before voting was due to start when a petrol tanker laden with gas cylinders was used in an attack on the electoral commission's headquarters in Abuja.
The attackers tried to roll the unmanned tanker into the building, but the vehicle missed its target and came to a halt.
The presidential poll was running alongside elections for the National Assembly and Senate.
The new government is scheduled to take power on 29 May.
Nigeria - one of the world's biggest oil producers - is of key strategic interest to both the West and the growing economies of the East.
But despite the country's huge oil wealth, tens of millions live in poverty.