A leading secular politician in Turkey has been sentenced to nearly 10 years in jail for "terror propaganda and insults" against the Turkish state.
Canan Kaftancioglu, 47, was convicted mainly over tweets which date back several years.
She has said the charges were politically motivated and remains free pending an appeal.
She heads the main opposition Republican People's Party (CHP) in Istanbul, the country's largest city.
Kaftancioglu played a key in the CHP's triumph in Istanbul's mayoral election in June, defeating the governing AKP party.
CHP's Ekrem Imamoglu beat the AKP candidate in the re-run poll, delivering a stinging blow to Turkish President Recep Tayyip Erdogan.
What was Canan Kaftanciouglu convicted of?
On Friday, she was sentenced to nine years, eight months and 20 days in prison.
She was accused of "insulting" President Erdogan and the Turkish state in the posts, as well as "spreading terror propaganda".
The charges related to 2013 anti-government protests and the outlawed Kurdistan Worker's Party (PKK).
The hashtag #TurkiyeSeninleCananBaskan (Turkey Stands With You, Chief Canan) trended online during Kaftanciouglu's trial in Istanbul.
Speaking shortly after the court's verdict, Mr Imamoglu said: "There is no justice in this country. In Turkey, instead of listening to their conscience, judges look towards the palace (the President's office)."
He said Ms Kaftancioglu was sentenced "because of her success in İstanbul elections".
What about the Istanbul mayoral re-run in June?
CHP candidate Ekrem Imamoglu beat his AKP rival Binali Yildirim, a former prime minister, by a bigger margin than he achieved in the earlier election.
That victory in March had been annulled after the AKP alleged irregularities.
Mr Yildirim conceded to Mr Imamoglu, while President Erdogan congratulated the CHP candidate on victory.
Mr Erdogan had previously said that "whoever wins Istanbul, wins Turkey".
He has ruled the country since 2003 both as prime minister and now president, becoming the most powerful leader since Mustafa Kemal Atatürk, the founder of the modern Turkish republic.