Social media platform X said Tuesday it has complied with a Turkish court order to block access in Turkey to the X account of jailed Istanbul Mayor Ekrem Imamoglu’s presidential campaign office, while challenging the decision in court.

In a statement, X said Turkish law required it to implement the restriction but that it disagreed with the order and had initiated legal proceedings to contest it.

According to a copy of the court order posted by X, an Istanbul court ruled that access to the account, which has about 225,700 followers, should be restricted on the grounds of protecting national security and public order.

Imamoglu, President Tayyip Erdogan’s main political rival, was detained on March 19, 2025, in a move that triggered Turkey’s largest anti-government protests in more than a decade. He remains in jail pending trial on charges including corruption, espionage and terrorism, all of which he denies.

Days after his detention, Imamoglu was chosen as the presidential candidate of the main opposition Republican People’s Party in an internal party vote. The day before his arrest, Istanbul University annulled his university diploma, a prerequisite for running for president under Turkish law.