ANKARA (Reuters) - A U.S. pastor denied terrorism and spying charges in a Turkish court on Monday and called them “shameful and disgusting”, in a prosecution that has been condemned by U.S. President Donald Trump.

Andrew Brunson, who could be jailed for up to 35 years, denied links to a network led by U.S.-based Muslim preacher Fethullah Gulen, who is accused by Turkey of orchestrating a failed military coup in 2016, and to the outlawed Kurdish PKK militant group.

The Christian pastor from North Carolina has lived in Turkey for more than two decades and has been in pre-trial detention since 2016.

“I am helping Syrian refugees, they say that I am aiding the PKK. I am setting up a church, they say I got help from Gulen’s network,” Brunson said, referring to the testimonies of anonymous witnesses in court.

One of the secret witnesses accused Brunson of trying to establish a Christian Kurdish state, and providing coordinates to U.S. forces in the delivery of weapons to the Kurdish YPG militia, active in northern Syria.

“My service that I have spent my life on, has now turned upside down. I was never ashamed to be a server of Jesus but these claims are shameful and disgusting,” Brunson told the court in the Aegean town of Aliaga, north of Izmir.

Brunson has been the pastor of Izmir Resurrection Church, serving a small Protestant congregation in Turkey’s third largest city.

Slideshow ( 6 images )

“I want to return to my home,” Brunson said at the end of the hearing, before the judge ruled that he should be kept in custody, adjourning the case to July 18.

TURKEY WANTS GULEN EXTRADITED

Brunson’s legal case is among several roiling U.S.-Turkish relations, including one in New York against a former executive of Turkish state lender Halkbank. The two countries are also at odds over U.S. support for the Kurdish militia in northern Syria, which Turkey considers a terrorist organization.

Erdogan suggested last year Brunson’s fate could be linked to that of Gulen, whom Turkey wants extradited.

Gulen denies any association with the coup attempt. Tens of thousands of Turks have been arrested or lost their jobs over alleged connections with it.

U.S. President Donald Trump tweeted after Brunson’s first court appearance last month that the pastor was on trial for “no reason”.

Slideshow ( 6 images )

“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 said.

Outside the court on Monday, Sandra Jolley, vice chair of the U.S. Commission on International Religious Freedom, called for the clergyman’s release.

“Every day that Andrew Brunson spends here in prison is another day that the standing of the Turkish government diminishes in the eyes of not just the U.S. but the entire world,” she told reporters.

Turkish Foreign Minister Mevlut Cavusoglu, who is expected to meet with U.S. counterpart Mike Pompeo in Washington this week or next, said on Saturday any decision was up to the court.

“They say that the government should release him,” he said. “Is it in my power? This is a decision the judiciary will make.”