Turkey has sentenced a U.N. war crimes judge to 7 1/2 years in prison on charges of "membership in a terrorist organization," an international court in the Hague said Thursday.

Turkish President Recep Tayyip Erdogan delivers a speech at the Grand National Assembly of Turkey in Ankara on Tuesday. ADEM ALTAN / AFP - Getty Images

Judge Aydin Sedaf Akay has been held in Turkey since September, one of tens of thousands of Turkish officials arrested in a crackdown on people and organizations after a foiled coup in which hundreds died.

The U.N. court said in a statement that Turkey's actions constituted a "further breach of Judge Akay’s protected status," as U.N. judges have diplomatic immunity under international law.

Following the guilty verdict, the Turkish court ordered his release under judicial control but barred him from leaving Turkey.

Akay is a judge at the Mechanism for International Criminal Tribunals (MICT), the Hague court set up to handle final appeals and other remaining cases from the Yugoslav and Rwanda war crimes tribunals, which are being wound down.

Related: U.S.-Based Cleric Blamed by Erdogan in Turkey Coup Bid

According to a statement by the MICT, Akay was convicted on Tuesday on a single charge of membership in "FETO" — which Turkey says is a terrorist organization that supports U.S.-based cleric Fethullah Gülen whom Ankara accuses of backing the coup.

Turkish President Recep Tayyip Erdogan claims Gulen was behind the bloody failed coup last summer. He denies the allegations.