Updated

The European Court of Human Rights on Tuesday called on Turkey to release the former head of Turkey's pro-Kurdish opposition from detention. Turkey's president responded by claiming his country was not bound by the court's rulings.

In its ruling on Tuesday, the Strasbourg, France-based court said Turkey had violated Selahattin Demirtas' right to be promptly brought before a judge, his right to a speedy review of his case as well as his right to be elected and to sit in Parliament.

Demirtas, the 45-year-old former co-chairman of the pro-Kurdish Peoples' Democratic Party, was arrested in November 2016 on terrorism charges. He ran in Turkey's presidential election in June from his high-security prison in Edirne, northwest Turkey. He also campaigned for a constitutional referendum in 2017 from behind bars.

In September Demirtas was sentenced to four years in prison for supporting the outlawed Kurdistan Workers' Party, or PKK, and engaging in terrorist propaganda in one of several trials against him. He is appealing his conviction.

Asked to comment on the European court's ruling, President Recep Tayyip Erdogan said: "We are not bound by the (European court's) decisions."

He added: "We'll make our counter-move and finish it off." He did not elaborate.

As a signatory of a European convention to protect human rights, the court's decisions are legally binding on Turkey.

Justice Minister Abdulhamit Gul said he needed to see the ruling, but added that a Turkish court would make the final decision on Demirtas' case.

The European court did not object to Demirta's initial arrest, but said there was no "sufficient" ground to justify the Turkish judicial authorities' extension of his detention period.

The court added that the extension of his detention time during the referendum and the presidential election had "pursued the predominant ulterior purpose of stifling pluralism and limiting freedom of debate, which was at the very core of the concept of a democratic society."

Considered one of Turkey's most charismatic politicians, Demirtas broadened his party's appeal beyond Turkey's mostly Kurdish-populated southeast region, winning the support of left-leaning and liberal voters. His party, however, is criticized for not sufficiently distancing itself from Kurdish rebels.