Senegal woke up Tuesday to a new president-elect, Bassirou Diomaye Faye, a former tax inspector and political newcomer who was released from prison just weeks ago.
Mr Faye had inspired voters, many of them unemployed youth, with a vow to fight corruption and reform the economy.
He was catapulted into a presidential campaign after popular opposition leader Ousmane Sonko, who was barred from running due to a prior conviction, had backed him.
As he gave his first speech as president-elect on Monday evening, it represented a dramatic rise for the 44-year-old who is due to be the youngest leader of the West African nation.
“I pledge to govern with humility and transparency and to fight corruption at all levels. I pledge to devote myself fully to rebuilding our institutions,” he said, restating promises made during his campaign.
While official results of Sunday’s vote were not yet available, the other front-runner — the former prime minister who was backed by incumbent President Macky Sall — had conceded defeat.
Mr Sall followed with congratulations, also naming Mr Faye as the winner.
The election followed months of unrest ignited by Mr Faye and Mr Sonko’s arrest last year, and concerns that the president would seek a third term in office despite constitutional term limits.
The violence shook Senegal’s reputation as a stable democracy in a region that has seen a wave of coups.
Rights groups said dozens were killed in the protests, while some 1,000 people were jailed.
Considered the anti-establishment candidate, Mr Faye’s campaign messages of economic reform and anti-corruption resonated with the youth.
Almost a third of young people are unemployed with thousands risking their lives on dangerous journeys in search of jobs in the West.
Mr Faye has vowed to improve Senegal’s control over its natural resources by promoting national companies to prevent the country from falling into what his campaign called “economic enslavement”.
His manifesto promised to renegotiate Senegal’s oil and gas contract and introduce a new currency.
The election was largely peaceful and early counts showed voters turned out overwhelmingly in favour of the opposition.
Mr Sonko had promised a resounding victory on his YouTube channel. By Monday evening in Dakar, Mr Faye had been declared the winner and celebrations erupted in neighbourhoods around the capital, where supporters danced, played music and set off fireworks.
Mr Faye’s roots lie in a small town in central Senegal. He is a practising Muslim and has two wives.
Ahead of Sunday’s election, Mr Faye published a declaration of his assets and called on other candidates to do the same.
It lists a home in Dakar as well as land outside the capital and in his hometown. His bank accounts hold roughly 6,600 US dollars (£5,212).
After studying law and graduating from Senegal’s National School of Administration in 2004, Mr Faye became a tax inspector.
This was when he met Mr Sonko, also a tax inspector, and joined his newly formed party PASTEF.
He quickly became a prominent figure in the party and was named general secretary in 2021.
“I would even say that he is more honest than me. I place the project in his hands,” Mr Sonko told supporters at a joint news conference in March of last year.
Weeks later, Mr Faye was arrested and jailed on various charges, including defamation.
Mr Faye paid tribute to Sonko in his speech but declined to say what role he would play in his government.