His body hollowed out by more than a year behind bars, his memory and his eyesight faltering, the prisoner listened to two hours of testimony claiming he had tried to undermine the government of Turkey. And then, it was his turn to speak.

“My faith teaches me to forgive. I forgive all those who testified against me,” he said at a hearing in July. “I leave these people to God.”

The prisoner is American evangelical pastor Andrew Brunson, who has become a flash point in the rapidly worsening relationship between the United States and Turkey.

Brunson was with charged abetting dissidents in 2016 and has recently been moved from prison to house arrest.

To hear Turkish officials describe him, Brunson, 50, is a dangerous dissident, an American who spent his time living in Turkey secretly aiding the state’s enemies, including those who orchestrated a failed coup against the Turkish government. To the American government and the evangelical community, Brunson is a man of God who was living quietly with his wife and children in Turkey for more than two decades as the pastor of a small local church with no political aspirations.

Brunson is among a handful of American citizens detained by Turkey for political reasons, according to U.S. officials. But he has been singled out in public statements by President Trump and Vice President Pence, who has frequently elevated Brunson while addressing Christian groups.

“Turkey would do well not to test @POTUS Trump’s resolve to see Americans who are wrongfully imprisoned in foreign lands returned home to the United States,” Pence said in a series of tweets Wednesday.

As Turkey’s feud with the United States has erupted into a trade war that has sent the Turkish lira tumbling, President Recep Tayyip Erdogan has seemed to bristle at the Trump administration’s effort to have Brunson released. “I call out to those in the United States. It is a shame,” Erdogan said during a speech on Saturday. “You are trading a strategic NATO ally for a priest.”

Brunson moved to Turkey in the early 1990s to fulfill a calling he seemed to have had his whole life. His parents were missionaries in the Associate Reformed Presbyterian Church, a small evangelical denomination. They raised Brunson in Mexico, where they pastored to a Christian community, and Brunson grew up speaking Spanish.

He returned to the United States to attend Wheaton College, a preeminent evangelical university, and later attended seminary and met his wife, Norine. The young couple wanted a life like the one Brunson had growing up, as missionaries in another country. They settled on Turkey.

“We even went to Turkish grade school because my parents wanted us to learn the language and feel comfortable in the culture. To me, it was home. My family, school and friends were in Turkey,” said the Brunsons’ daughter, Jacqueline Furnari, when she testified before the Commission on Security and Cooperation in Europe, a U.S. government agency. Furnari has spoken and written for months on her father’s behalf. She has shared emotional struggles such as her father missing her wedding and her brothers’ academic achievements during his imprisonment.

“On holidays, we sometimes hung a Turkish flag from our balcony, as our neighbors did. We loved and respected the Turkish people, and my parents were dedicated to serving the Turkish people for as long as they could,” Furnari said, according to her prepared remarks.

And then came October 2016, when Brunson and his wife received a summons to a police station. They went, fearing they might be deported. Instead, they were detained.

Norine Brunson was later released days later. Her husband was indicted on charges of “acting in a parallel and coordinated fashion” with Turkey’s two principal enemies: the Kurdistan Workers’ Party, or PKK, and a network run by Fethullah Gulen, a Turkish cleric accused of fomenting a failed coup in 2016. The indictment also says Brunson aimed “to divide and separate” Turkey through the “Christianization” of members of the Kurdish minority.

The pastor’s arrest coincided with a large-scale crackdown by Turkish authorities on the two groups and their members, people accused of being associated with the groups, anti-government dissidents, and, in some cases, people who had committed no crime at all, according to human rights groups.

Serkan Golge, a NASA research scientist who is Turkish American, was also arrested after the failed coup, convicted of ties to Gulen’s organization and sentenced in February to 7½ years in prison. American officials have denied they are only focusing on Brunson and said they are working to free all of the Americans detained over the past two years, as well as three employees of the U.S. mission in Turkey.

Turkish officials have repeatedly condemned American calls for Brunson’s release as interference in Turkey’s judicial process. At other times, they seem to acknowledge that he is a bargaining chip in their ongoing disputes with the United States, as Erdogan did in a speech last year. “Give us that pastor,” he said, referring to Gulen, who is living in Pennsylvania, “and we will do what we can in the judiciary to give you this one.”

Christians are a small minority in Turkey, where 98 percent of the population is Muslim, according to Pew. Michael Walsh, an Australian who met Brunson in Turkey, said that during his first week in town, he asked staff at his hotel where to find a church; no one had ever heard of a church in the city.

By happenstance, Walsh spotted a man carrying what looked like a Bible and followed him. It led him to Brunson’s church.

“Suddenly I realized my prayers had been answered: Here I am in a church!” Walsh recalled. He came back while he was working in Turkey and talked with Brunson about his life in the country and the small Christian community he was leading.

The evidence against Brunson in the indictment includes phone messages, documents and statements by various witnesses, including witnesses referred to by code names such as “Fire” and “Meteor.” His actions, as described in the document, ranged from seemingly ordinary (“Andrew and his wife Norine joined in on the Muslim iftar”) to those that were portrayed as attempts at “brainwashing” Turks.

“One scene I witnessed was 25 Turkish University students taking an oath by putting their right hands over their hearts, accompanied by the ‘Star-Spangled Banner,’ ” one witness is quoted as saying.

The main topic of Brunson’s last court hearing in July appeared to be his associations with Kurdish congregants and whether those contacts amounted to support for the PKK, which is considered a terrorist group by both Turkey and the United States. State witnesses portrayed the church as a hive of PKK sympathy.

Other witnesses said they had never seen anything of the sort.

“He has no interest in Turkish politics,” said Umut Dogan, a leader in Brunson’s church who said he has known the pastor for 11 years. “He never gets involved with anything besides religion.”

Kristina Arriaga, the vice chair of the U.S. Commission on International Religious Freedom, visited Brunson last year in prison, where she was struck by the overcrowding. Brunson came into the room holding up his pants with his hands, because he had lost 50 pounds in his first year in prison, she said.

“What do you tell an American who asks you, ‘Why am I in prison? This is a NATO ally. I did absolutely nothing wrong’?” Arriaga said. “He said, ‘You know I’m innocent, right? You know I’m innocent, right?’ ”

She told him about the Spanish expression her father quoted when he was suffering from severe depression: “Un paso a la vez. One step at a time.” Since then, when Brunson has written her thank-you notes for her activism on his behalf, he has quoted the expression back to her.

Arriaga watched Norine Brunson when she attended Brunson’s hearing in July. Because her husband’s eyesight is deteriorating and observers had to sit far in the back of the room, Norine Brunson stood up repeatedly, gesturing broadly so that he would see.

Brunson, wearing a suit and speaking in Turkish, said to the judges that some of the witnesses harbored grudges against the church or were prejudiced against Kurds. The accusations that his church had favored Kurds, Syrians and others over Turks were baseless, he said. “In our church there is no discrimination,” he said.

Charges of espionage were also false, he added. “I look at myself as a patriot for America but I didn’t come to represent Americans,” Brunson said. “I came as a representative of God.”

Kareem Fahim contributed to this report from Istanbul.