Senegal's ruling coalition suffered crushing defeats in the capital Dakar and other major cities in Sunday's local elections, local media reported, in a vote seen as a key test for the president.
Provisional results published by local media on Monday showed coalition losses in Dakar, nearby Thies and Guediawaye, as well as the southern city of Ziguinchor, and the largest city in central Senegal, Kaolack.
The vote was the first in the West African country since lethal riots last year, sparked by the arrest of 46-year-old opposition leader Ousmane Sonko.
Analysts view the vote as a litmus test for support for President Macky Sall, 60, whom the opposition suspects is planning a bid for a third presidential term in 2024.
Alioune Tine, director of the think tank Afrikajom Center, told AFP that the election had been a "debacle" for the ruling coalition.
Fierce opponents of Sall's came out as winners. For example, Sonko topped the poll to become mayor of Ziguinchor, according to provisional results reported by local media.
Barthelemy Dias, another staunch Sall opponent, is set to become mayor of Dakar, according to the same provisional results.
In contrast several allies of the president's, including Health Minister Abdoulaye Diouf Sarr, lost their races.
Sunday's vote was to decide the mayors of more than 500 municipalities and the heads of Senegal's 46 departments.
On Sunday evening, the ruling Bennoo Bokk Yaakaar alliance admitted in a statement that it had stumbled in key cities.
"Overall, the national trend shows our coalition winning easily in several regional capitals," it said. "But our bid to take Dakar and Ziguinchor has not been conclusive."
Official election results are expected early this week.
In March last year, Senegal was rocked by several days of clashes and looting after opposition leader Ousmane Sonko was summoned to court to answer charges of rape in a case that he said was politically motivated.
At least 12 people were killed nationwide, a toll that shocked a country considered a beacon of stability in a volatile region.
Tine, the think tank director, said the surge in support for the opposition last year was now being reflected in the ballot box.
As well as supporting Sonko, protesters in 2021 also took to the streets to demonstrate their opposition to a potential third-term bid by Sall.
Critics fear that the president will seek to exploit constitutional changes approved in 2016 to argue that a two-term limit for presidents does not apply, and run again.
In October 2021, Sall's chief of staff Mahmoud Saleh was quoted by Senegalese media as saying that the elections will be "local in name only".
He added that the results would determine how the parliamentary elections go, and "decide the debate" on Sall's candidacy for the 2024 presidential election.
Sall later characterised the comments as a "major gaffe" in an interview with French broadcaster RFI, and denied any link between the local elections and his political fate.
However, he has never denied that he will seek a third term.
Sall was first elected in 2012 on promises to help the poor in the nation of 17 million people. He won a second term in 2019, beating Sonko, but has come under increasing criticism since then.
Following the local elections he is now expected to appoint a new cabinet -- and will face a revived opposition.
The president is well respected on the international scene, particularly over jihadist violence in the Sahel region, but his critics view him as serving the business interests of Senegal's former colonial power France.