Thousands of supporters of the Senegalese opposition leaders Ousmane Sonko and Bassirou Diomaye Faye were celebrating on Friday after the pair emerged from prison in Dakar.
Their release - which was announced on state channel RTS on Thursday night - follows weeks of crisis after President Macky Sall postponed the scheduled presidential poll on 25 February.
Sonko, who is expected to return home on Friday afternoon, has emerged as one of Sall's main opponents since coming third in the 2019 presidential election.
But after he was disqualified from running in the 2024 poll he then endorsed Faye to replace him on the ballot even though he had also been in prison since April 2023.
Rumours
As rumours of the men's release began to circulate on social media, crowds took to the streets of the capital to celebrate.
Cars and pedestrians waving Senegalese flags gathered at the prison where the two men had been detained.
"We love Sonko", they chanted.
"It's a joy. It's incredible. They released Ousmane Sonko," said 31-year-old Mamadou Mballo Mane.
Their liberation comes after 62-year-old Sall proposed a bill granting amnesty for acts committed in connection with political demonstrations since 2021.
End
Sall, who has ruled in Senegal since April 2012, is not standing for re-election. His sudden decision to defer the February presidential vote sparked clashes that left four dead.
A new date was finally set for 24 March after a month of political crisis.
Bouts of unrest since 2021 have led to dozens of deaths and hundreds of arrests in a country often viewed as a bastion of stability in western Africa where several other countries such as Guinea, Burkina Faso and Mali undergone military coups.
Sonko has always maintained there was a plot to keep him out of the 2024 election, while his camp and the government have traded blame for the violence.
He was sentenced twice in 2023 for defaming a minister and for corrupting a minor and had been in prison since the summer on a string of other charges, including provoking insurrection, conspiracy with terrorist groups and endangering state security.