Senegal's President Abdoulaye Wade has admitted defeat in a run-off election to his rival Macky Sall, state media say.
The president conceded in a telephone call to the former prime minister.
Mr Wade had changed the constitution to be able to run for a third consecutive term. The move sparked violent protests earlier this year, leaving six people dead.
Mr Wade, 85, has ruled the West African nation for 12 years.
Celebrations in Dakar
Mr Wade "phoned his rival Macky Sall at 21:30 GMT to congratulate him after the first results showed him to be the winner of a presidential run-off," the Senegalese Press Agency said on Sunday.
Mr Sall, 50, has so far made no public comments.
Even before Mr Wade's concession, thousands of Sall supporters began celebrating on the streets of the capital, Dakar.
They chanted "Macky president!" and "We have won!"
Mr Wade's move alleviated fears of fresh violence in the country.
In February's first round, Mr Wade fell short of a majority, polling only 34.8%. Mr Sall came second with 26.6%.
Mr Sall owes his political career to Mr Wade, and had held several ministry portfolios before becoming prime minister, the BBC's Thomas Fessy reports from Dakar.
But, the two men fell out over the handling of public spending by Karim Wade, the president's unpopular son, whom many believe has been trying to succeed his father, our correspondent adds.
Mr Sall has promised that, if elected, he will shorten the presidential term to five years from the current seven, and enforce a two-term limit. He has also promised to bring in measures to reduce the price of basic foodstuffs.
The new leader also faces the difficult task of tackling rising unemployment in the country, our correspondent says.