Turkey formally arrested President Recep Tayyip Erdogan’s main political rival, a decision likely to trigger more market turmoil and protests across the country.

Ekrem Imamoglu, Istanbul’s mayor, was jailed on corruption charges Sunday morning, days after being detained by police.

The case has the potential to keep Imamoglu, who denies the charges, behind bars for years and prevent him from running against Erdogan in the next elections. He is the most prominent person to be ensnared in a recent wave of detentions and investigations against opposition figures.