President Abdoulaye Wade conceded defeat to his former protege Macky Sall, congratulating him several hours after polls closed when preliminary results showed the opposition candidate had trounced the 85-year-old incumbent.
Mr Wade called Mr Sall to congratulate him on his victory, state television reported.
The move alleviated fears that Mr Wade would attempt to stay in office after 12 years or would challenge the run-off results.
Even before Mr Wade conceded, Mr Sall's supporters began celebrating in the streets of the capital, singing and marching through Dakar.
Some even danced on the roofs of moving vehicles, and one man did a cartwheel amid the traffic near the Place de l'Independance.
Sociologist Hadiya Tandian said that Mr Wade's concession washes away the wounds of a violent election season, which left at least six people dead and tarnished the country's reputation, saying: “This is a great victory for Senegal - it shows the maturity of our democracy.
“It shows that the Senegalese believe in their voter IDs, that a voter card can change something, can make a difference. It shows that our long democratic heritage continues to live in us day by day.”
At a midnight press conference at a hotel, Mr Sall said the maturity of Senegalese voters was a source of pride.
“Tonight, a new era begins for Senegal,” he told hundreds of journalists and supporters.
Mr Wade, who first took office in 2000, has seen his popularity suffer amid soaring costs of living and unemployment in this country on Africa's western coast.
He spent 25 years in the opposition fighting to loosen the grip of the former socialist party, which ruled this former French colony for 40 years since independence in 1960.
His image began to suffer after he began giving an increasing share of power to his son Karim, who was derisively called “the Minister of the Sky and the Earth” after he was handed control of multiple ministries including infrastructure and energy.
Mr Wade's reputation took a nosedive when he announced last year that he planned to run for a third term.
For weeks leading up to last month's election, protesters calling for Mr Wade to step down hurled rocks at police in demonstrations that paralysed the capital's economic heart.