ALIAGA (Turkey) (AFP) - A Turkish court ruled Monday to keep an American Christian pastor in custody, deeming him to be a flight risk, after his trial opened in a case that has raised tensions with Washington.

Andrew Brunson, who ran a Protestant church in the western city of Izmir, has been detained by Turkish authorities since October 2016. If convicted, he risks up to 35 years in jail.

Brunson -- wearing a black suit, speaking fluent Turkish and sometimes bursting into tears -- emphatically rejected all the charges against him at the first court hearing in the town of Aliaga north of Izmir.

He is accused of engaging in activities on behalf of the group led by exiled Muslim preacher Fethullah Gulen -- who Ankara says is behind a failed 2016 coup -- and the Kurdistan Workers' Party (PKK).

Both the Gulen movement and the PKK are banned by Turkey as terror groups.

Brunson is also accused of espionage for political or military purposes.

The judge ordered Brunson to stay in jail, setting the next hearing for May 7.

The ruling was based on evidence given by witnesses in the case and the risk that Brunson might flee.

The United States expressed concern.

"We have seen no credible evidence that Mr Brunson is guilty of a crime and are convinced that he is innocent," State Department spokeswoman Heather Nauert said.

"We hope that the judicial system in Turkey will resolve his case in a timely, fair and transparent manner."

In an indication of the importance of the case for Washington, the hearing was attended by Sam Brownback, the US ambassador at large for religious freedom, and Senator Thom Tillis from Brunson's home state of North Carolina.

"We are very disappointed. If anything, I think the information that has been presented today creates a more compelling reason why he is innocent," Tillis told reporters after the ruling.

Brunson reacted with emotion, telling his wife Norine in English: "I am going crazy. I love you."

He had earlier told the judge tearfully: "I want to return my home. For 16 months, I have been separated from my wife."

Story continues

- 'Reject all accusations' -

"I want the whole truth to be revealed. I reject all the accusations in the indictment. I haven't been involved in any illegal activity," Brunson told the court.

"I haven't done anything against Turkey. On the contrary, I love Turkey. I have been praying for Turkey for 25 years."

He moved to the country in 1993 and opened his Izmir church in 2010.

The Brunson case has further hiked tensions between NATO allies Turkey and the United States, with US President Donald Trump raising the issue in talks with Turkish counterpart Recep Tayyip Erdogan.

Relations are already strained over American backing for a Kurdish militia in Syria despised by Ankara and the jailing of two employees at American missions in Turkey.

"That relationship is going to have difficulty in moving forward as long as Andrew Brunson is incarcerated," Brownback told reporters at the courthouse.

In September, Erdogan suggested that Turkey could free Brunson if Washington handed over Gulen, who lives in self-imposed exile in Pennsylvania.

Washington brushed off the offer but has been working intensely to secure the release of Brunson, one of several American nationals caught up in the crackdown after the failed coup against Erdogan in July 2016.

In February, NASA scientist Serkan Golge, a dual national, was jailed for 7.5 years for being a member of Gulen's movement in a conviction denounced by Washington.

Senator Tillis said there was "no deal," adding: "This is about what we believe is an innocent man who has been in prison for a year and a half."

In his statement to the court, Brunson rejected the accusations of links to Gulen's group, saying: "That would be an insult to my religion. I am a Christian. I would not join an Islamic movement."

Gulen denies any role in the failed coup and says his Hizmet (Service) movement promotes a peaceful form of Islam.

Numbering just several thousand, the Protestant community in overwhelmingly Sunni Muslim Turkey largely comprises converts from Islam, expatriates and refugees.

The Turkish Association of Protestant Churches said in a report that 2017 was marked by continued hate crimes and physical attacks.

Brownback described the trial as a "religious freedom case."

"Turkey, in its history, has been very open, so that's one of the things that's really troubling about this," he said.