American pastor Andrew Brunson, who was jailed in Turkey in October due to alleged links to the Gülen group, has been released from jail and placed under house arrest, the state-run Anadolu news agency reported.

Turkish prosecutors accuse Brunson of activities on behalf of the PKK as well as the Gülen group inspired by US-based preacher Fethullah Gülen, accused by the Turkish government of orchestrating a July 2016 coup attempt in Turkey.

The group denies any involvement in the putsch.

Turkey’s state-run Anadolu news agency said a “secret witness” — described as a former parishioner codenamed “Serhat” — testified via a long-distance system and claimed that Brunson helped Kurdish militants, including those fighting in Syria, in various ways. He also claimed that a Syrian who converted to Christianity had helped Brunson.

Brunson, who has lived in Turkey for decades, strongly rejected the claims.

“These accusations are shameful and disgusting. There is not one photograph or tape recording praising the PKK at the [Izmir] Resurrection Church. Our church had several Turkish followers. Our doors were open to everyone. I strived to prevent politics from entering the church,” Anadolu quoted Brunson as saying.

The indictment against him — based on the testimony of witnesses, including three secret ones, and digital evidence — claims the pastor worked to convert Kurds to Christianity to sow discord in Turkey.

Brunson, who has lived and worked in Turkey for over two decades, is also accused of espionage for political or military purposes.

He denied all the charges leveled against him during the first hearing last month and from time to time broke down in tears.

“I haven’t done anything against Turkey. On the contrary I love Turkey. I have been praying for Turkey for 25 years,” he told the judge.

U.S. Embassy Chargé d’affaires Philip Kosnett and Sandra Jolley, vice chair of the US Commission on International Religious Freedom, were present at the May 7 hearing.

The case has further inflamed tensions between NATO allies Turkey and the United States. Trump said the pastor was on trial and being prosecuted for “no reason,” in a tweet after the Turkish court ruled to keep him in jail.

“They call him a Spy, but I am more a Spy than he is. Hopefully he will be allowed to come home to his beautiful family where he belongs!” Trump tweeted.

The State Department said it had seen “no credible evidence” that Brunson was guilty of a crime.

Top US officials have raised the pastor’s case in meetings with Turkish authorities and have called for Brunson’s release.

Foreign Minister Mevlüt Çavuşoğlu, who will soon meet with his US counterpart, Mike Pompeo, in Washington, said Brunson’s case was a legal one.

“They say ’the government should release him.’ Is it up to me? This is a decision the judiciary will make,” Çavuşoğlu told broadcaster CNN Türk in an interview on Sunday.

The court on Monday ruled to continue Brunson’s pretrial detention and set the next hearing for July 18.