FILE PHOTO: Protestors demonstrate, calling for the freedom of German-Turkish journalist Deniz Yucel, in the streets of Berlin, Germany, February 19, 2017. REUTERS/Axel Schmidt

ANKARA (Reuters) - Turkish President Tayyip Erdogan ruled out on Friday extraditing German-Turkish journalist Deniz Yucel to Germany while he is in office, repeating his assertion that Yucel is a “terrorist agent”.

Yucel, a national of both countries, was arrested two months ago on charges of making propaganda in support of a terrorist organization and inciting the public to violence. Yucel denies the charges.

Erdogan said that German Chancellor Angela Merkel had asked him to extradite Yucel but that he had denied her request saying the journalist would be tried in Turkish courts, which he said would ensure a fair trial.

Erdogan said there was no doubt Yucel had links to the outlawed Kurdish militant group PKK. “This person is a complete terrorist agent. Not all journalists are clean,” he said.

“But we will do what is necessary, within the framework of the law, against those who act as agents and threaten my country from Qandil,” Erdogan said, referring to a PKK base camp in northern Iraq.

Yucel, a reporter with the German daily Die Welt, was initially detained after he reported on emails that a leftist hacker collective had purportedly obtained from the private account of Berat Albayrak, Turkey’s energy minister and Erdogan’s son-in-law.

Since a failed coup attempt in July, Turkish authorities have arrested 40,000 people and suspended 120,000 from jobs in the police, military, the civil service and the private sector.

Western governments have criticized the crackdown but Turkey says the measures are necessary given the security threats it faces.

(This story has been refiled to fix typo in headline)