(Bloomberg) -- At least nine people died in clashes between protesters and police after a Senegalese court sentenced the country’s main opposition politician to jail, barring him from taking part in next year’s presidential election.

The government restricted the use of social media platforms including Facebook, Twitter and WhatsApp in an effort to quell the unrest.

“Seeing the calls for violence and hatred, the state decided to temporarily suspend the use of certain digital applications,” Interior Minister Antoine Felix Diome said in a statement on state broadcaster RTS late Thursday. Sonko has been confined to his home to try and ease tensions, government spokesman Abdou Karim Fofana told reporters in Dakar, the capital. 

Ousmane Sonko, who was on trial for allegedly raping and making death threats against a massage-parlor employee in 2021, was convicted of morally corrupting a youth on Thursday. The court acquitted him of the rape charge. The ruling will strip him of his electoral rights, rendering him ineligible to stand for president, unless there is a successful appeal, said Cire Cledor Ly, one of his lawyers. 

Supporters of the Pastef les Patriotes party leader burnt tires and clashed with security forces across a dozen neighborhoods in Dakar after the judgment, forcing shops and restaurants to close early. In the southern town of Ziguinchor, where Sonko is also the mayor, at least one person was killed, according to the authorities.

Sonko’s party urged the Senegalese army to join the demonstrations.

“The role of the state is to protect the population and maintain order,” Fofana said.

Sonko, a 48-year-old former tax inspector, has represented the biggest threat to Senegalese President Macky Sall or whoever his party nominates to run in the election. Sonko’s popularity has swelled since 2019, when he came third in presidential elections with 16% of the vote. Sall, 61, secured his reelection with 58%, while his closest rival at the time, Idrissa Seck, has since joined his administration.

©2023 Bloomberg L.P.