ANKARA (Reuters) - A Turkish court on Friday sentenced the former head of the pro-Kurdish opposition to more than four years in jail on terrorism charges, broadcaster CNN Turk said, marking the first conviction for Selahattin Demirtas after 23 months in prison.

FILE PHOTO: Supporters of Turkey's main pro-Kurdish Peoples' Democratic Party (HDP) hold masks of their jailed former leader and presidential candidate Selahattin Demirtas during a rally in Ankara, Turkey, June 19, 2018. REUTERS/Umit Bektas

Demirtas, one of Turkey’s best-known politicians, has been jailed for almost two years while on trial for a series of terrorism-related charges. He faces a total of up to 142 years in prison if convicted, but has so far denied the charges.

On Friday, the court sentenced Demirtas to four years and eight months for carrying out terrorist propaganda at a speech in 2013, when the government was holding peace talks with Kurdish militants for a ceasefire.

The court also sentenced Sirri Sureyya Onder, a former lawmaker from Demirtas’ People’s Democratic Party (HDP), to three years and six months in prison on the same charges, CNN Turk said.

President Tayyip Erdogan accuses Demirtas and the HDP of links to the outlawed Kurdistan Workers Party (PKK), which has carried out a decades-long insurgency against the Turkish state.

Both Demirtas and the HDP have denied the accusations of being linked to the PKK, designated a terrorist organization by Turkey, the European Union and United States.

In June, while campaigning for re-election in presidential elections, Erdogan called Demirtas a terrorist and said he was responsible for the deaths of Kurdish civilians during unrest three years ago.

Demirtas, a former human rights lawyer, ran against Erdogan in the elections, and campaigned from prison, largely through social media.

After having won votes beyond his core Kurdish constituency in previous elections, Demirtas failed to mount a significant challenge to Erdogan in June, winning 8.40 percent of votes against Erdogan’s 52.59 percent.

However, his HDP remains the second-largest opposition party in Turkey’s newly restructured 600-member parliament. Erdogan’s ruling AK Party and their nationalist MHP allies hold the majority.