Senegal's reputation as a bastion of democracy in an unstable region is on the line after protesters clashed with riot police outside parliament on Monday.
Inside, lawmakers passed a contentious bill to extend President Macky Sall's tenure and delay elections after he called off a planned election with just three weeks to go.
The opposition say some of their members were forcibly removed from the parliament building by police in riot gear to stop them from voting.
Khalifa Sall, a leading opponent and a former mayor of Dakar, who is not related to the president, called the delay a "constitutional coup" and urged people to protest against it. His political coalition has vowed to go to court.
Thierno Alassane Sall, another candidate, also no relation, called it "high treason" and urged his supporters to gather in front of the National Assembly to protest and "remind MPs to stand on the right side of history".
The proposal needed the support of three-fifths (ie 99) of the 165 deputies to pass. The ruling Benno Bokk Yakaar coalition, of which President Sall's Alliance for the Republic party is part, has a slight majority in parliament.
In the end 105 MPs voted for the proposal. A six-month postponement was originally proposed, but a last-minute amendment extended it to 10 months, or 15 December.
Mr Sall reiterated that he was not planning to run for office again. But his critics accuse him of either trying to cling on to power or unfairly influencing whoever succeeds him.
No sooner had he announced the unprecedented postponement than protesters marched across the capital, Dakar, to call for a reversal. At least 150 people have been arrested in the past two days.
West Africa's regional bloc Ecowas on Tuesday pleaded for Senegal's political class to "take steps urgently to restore the electoral calendar" in line with the constitution.
Former Prime Minister Aminata Touré condemned the passage of the bill in a post online.
Senegal has long been seen as one of the most stable democracies in West Africa. It is the only country in mainland West Africa that has never had a military coup. It has had three largely peaceful handovers of power and never delayed a presidential election.
Until now.
In 2017, Senegalese troops led the West African mission sent to neighbouring The Gambia to force out long-time ruler Yahya Jammeh after he refused to accept he had lost an election. And in a region beset by coups, President Sall has been a key actor in the push by Ecowas to force military leaders to conduct elections and hand over power to civilians.
But Senegal's democratic credentials now hang in the balance, and a constitutional crisis is brewing. The country faces a critical test of its electoral integrity and judicial independence, analysts say.
Tensions have been rising for more than two years following what the opposition say was a deliberate attempt to exclude them from the election by having their candidates charged with crimes they had not committed. One major opposition party was even banned.
The authorities have denied using the legal system for political gain and President Sall said he was trying to calm things down by delaying the vote but this does not appear to have worked so far.
"The decision has thrown Senegal into uncharted waters of a constitutional crisis," Mucahid Durmaz, senior West Africa analyst at risk intelligence company Verisk Maplecroft, tells the BBC.
"The constitution requires elections to be organised at least 30 days before the end of the incumbent president's mandate. Sall's rule expires on 2 April. And the decree detailing the electoral calendar must be released 80 days before the vote takes place. Even if he appoints a transitional president after 2 April, the legality of it will be disputed."
Authorities restricted access to mobile internet services on Monday to prevent what they called "hateful and subversive messages" from spreading online and posing a threat to public order - in other words to make it harder for protesters to organise.
Some residents tell the BBC they have been using wifi and Virtual Private Networks (VPN's) to bypass the curbs but not everyone is able to do this.
The opposition has condemned the shutdown of the signal of private television channel Walf TV for "incitement to violence" over its coverage of the demonstrations.
Two opposition politicians, including former Prime Minister Aminata Touré, once a close ally of President Sall but now one of his harshest critics, were both briefly detained following the protests.
Critics fear that this clampdown could plunge the country into further political turmoil which, by extension, could be dangerous for the whole West African region.
Satisfaction with democracy in Senegal has declined sharply under Mr Sall. In 2013 Afrobarometer, a pollster, found that after Mr Sall had taken office, more than two-thirds of Senegalese people were fairly or very satisfied with democracy. By 2022 less than half were.
However, Durmaz says he does not foresee the possibility of a military coup because Senegal has a "diverse range of political parties, a robust civil society and influential religious leaders who step in to mediate political disputes between the politicians".
Twenty candidates had made the final list to contest the elections, but several more were excluded by the Constitutional Council, the judicial body that determines whether candidates have met the conditions required to run.
Prominent among them were firebrand opposition leader Ousmane Sonko barred because of a libel conviction, and Karim Wade, the son of a former president, who was accused of having French nationality. They both say the cases against them are politically motivated.
Despite the delay, it is unlikely Mr Sonko will be able to participate in the election, as his party has already replaced him with Bassirou Faye who is also in jail but remains eligible to run, Mr Durmaz says.
Mr Sonko has shown that he is able to mobilise his supporters on to the streets and so while he remains barred, tensions are likely to stay high.
His banned Pastef party has vowed to push back against the delay, calling it a "serious threat to our democracy" and "contempt for the will of the people".
This is not the first time leading opposition candidates have been barred from running in presidential elections. Both Karim Wade and Khalifa Sall were jailed for corruption in 2015 and 2018 respectively, and barred from running in 2019.
This time, allegations of judicial corruption involving the Constitutional Council, brought by Karim Wade's party, prompted a parliamentary inquiry.
President Sall justified the election delay by saying time was needed to resolve the dispute that ensued between the Council and some members of parliament.
Despite the widespread anger over the delay, Mr Wade's Senegalese Democratic Party (PDS) has backed it, and if its MPs vote with the government, the bill could pass.
But Wole Ojewale, Dakar-based regional co-ordinator for Central Africa at the Institute for Security Studies, says the delay is not justified.
"The president is not in charge of the electoral process, and to the extent to which the electoral umpire has not raised doubts about their capacity to undertake the election. I don't think anything should derail the political process."
Mr Sall's critics suggest he may have feared his chosen successor, Prime Minister Amadou Ba, was in danger of losing the election.
"His [President Sall's] party is losing momentum. There are indications that they probably want to see how they can rejig, or probably replace their candidate," Ojewale says.
He says there is still a window to conduct the election as scheduled. Otherwise, the country may be plunged into widespread unrest, becoming a police state where civil liberties are eroded, a view Durmaz shares.
Ecowas and the African Union have called for dialogue. France, the US and the EU have all called for an election as soon as possible.
However, Durmaz says President Sall's international image would minimise any external pressure on him.
"I do not expect a firm push by Ecowas to reverse the postponement of the election in Senegal," he says, noting that the credibility of regional organisations such as Ecowas and the AU "has been significantly tarnished due to their inability to confront the democratic deficit in civilian-run countries".
All eyes will now be on the regional blocs to see how they treat yet another democratic headache in West Africa.
Latest Stories
-
The Conscience of Leadership: A call to President Akufo-Addo on Ghana’s environmental devastation
8 mins -
Ghanaian youth unaware of their right to hold politicians accountable – Youth Bridge Foundation
1 hour -
Judge delays Trump sentencing for a third time
1 hour -
2024 WAFCON: Ghana drawn against defending champions South Africa in Group C
2 hours -
Photos from DW-JoyNews street debate on ‘galamsey’
3 hours -
Mimmy Yeboah: Blending heritage with global sophistication, confidence redefined through couture
3 hours -
100 Most Influential People Awards 2024: Brain Hill International School’s Director Mary Anane Awuku honoured
3 hours -
Akufo-Addo commissions 97-km Tema-Mpakadan railway line
3 hours -
Majority requests recall of Parliament
4 hours -
Kanzlsperger and Professor Quartey support WAFA with medical Donation
4 hours -
Gideon Boako donates 10 industrial sewing machines to Yamfo Technical Institute
4 hours -
‘Golden Boy’ Abdul Karim Razak honored at WAFU-B general assembly
4 hours -
Buipewura Jinapor secures Vice Presidential position in National House of Chiefs with record votes
4 hours -
2024 election: I want results to come out like ‘milk and honey’ – Toobu
4 hours -
Ghana’s Henry Bukari hands over chairmanship of ECOWAS Brown Card Council of Bureaux
4 hours