Turkey’s President Recep Tayyip Erdoğan has threatened his country’s top court for releasing two journalists detained on charges of attempting to overthrow the government.

The court’s future is in doubt if it were to make another such ruling, he said.

“I hope the Constitutional Court will not try to repeat this in a way that would call into question its existence and its legitimacy”, President Erdoğan said, according to AFP.

The Constitutional Court released newspaper Cumhuriyet's editor-in-chief Can Dündar and Ankara bureau chief Erdem Gül in February.

It ruled that keeping the two men in pre-trial detention was a violation of their rights and freedom of expression.

The pair still face trial on March 25 on charges of revealing state secrets and attempting to overthrow the government, after Cumhuriyet published claims in May that Turkey tried to deliver weapons to Islamist rebels in Syria.

Prosecutors have reportedly demanded multiple life sentences for the journalists.

Mr Erdoğan said the Constituional Court’s decision to release the men was “against the country and against its people”.

Immediately after the court’s ruling in February, Erdoğan said, “I do not abide by the decision or respect it”.

President Erdogan said: 'The media should not have unlimited freedom' (AFP/Getty Images)

“The media should not have unlimited freedom. There is no absolute freedom anywhere in world media either.”

The journalists’ prosecution comes during a crackdown on press freedom by Erdoğan’s increasingly authoritarian government.

Turkey’s largest newspaper, Zaman, was taken over by government administrators last week. Its editor and chief columnist were fired, and its staff were told to expect “a change in editorial policy”.

Turkey's Zaman: Editorial tone changes after takeover

The government accuses Zaman of supporting US-based cleric Fethullah Gülen, who has been charged with conspiring to overthrow the government.

Bugün, a daily newspaper and part of a media group which runs two opposition television stations, was also taken over in a court-ordered raid in October. It too was accused of links to Mr Gülen.