A Turkish opposition leader has been sentenced to nearly 10 years in jail after being convicted of terrorist propaganda and insulting government officials through a series of social media posts.

Canan Kaftancioglu, who heads the Istanbul branch of the secular Republican People’s Party, received a prison sentence of nine years and eight months for insulting President Recep Tayyip Erdogan and other accusations, the state-run Anadolu Agency reported.

Kaftancioglu denied wrongdoing. She plans to appeal and will not be imprisoned until the outcome of that process.

Turkey Opposition Politician
Canan Kaftancioglu spoke to supporters gathered outside the courthouse after her trial in Istanbul (AP)

The politician is a key opposition figure who helped deliver a stunning victory for colleague Ekrem Imamoglu in Istanbul’s mayoral election, dealing a major blow to Mr Erdogan.

Republican People’s Party leader Kemal Kilicdaroglu described Kaftancioglu as a victim of political “vengeance” and vowed to fight for justice.

The Anadolu Agency said she was found guilty of the charges of insulting the Turkish republic, state officials and Mr Erdogan as well as making terrorist propaganda and inciting public enmity.

Prosecutors sought up to 17 years in prison for her social media posts. They included a 2013 tweet referring to the co-founder of an outlawed Kurdish militant group who was killed in Paris.

Opposition broadcaster Halk TV said the court refused to suspend the sentence on the grounds that she had not shown any remorse during the course of the trial.

Large crowds gathered outside the courthouse in Istanbul and protested against the verdict, shouting demands for “rights, laws, justice”.

The former leader of Turkey’s pro-Kurdish party, Selahattin Demirtas, and other party officials are in jail on terror-related charges.