Trump demands American pastor's release from Turkey as Congress weighs new sanctions The president has tweeted his detainment is "a total disgrace."

President Trump is demanding that Turkey release an American pastor it has held for nearly two years after a Turkish judge ruled to keep him in detention for three more months.

His message comes as the Senate weighs bipartisan legislation that would restrict loans from international financial institutions to Turkey until it releases Andrew Brunson and other U.S. citizens, of which there are more than a dozen.

The extension of his detention is also a sign that U.S. relations with its NATO ally have not improved despite attempts by senior officials to repair the distrust and paper over the hostility.

Following an attempted coup in Turkey in 2016, Brunson, a 50-year-old evangelical pastor from North Carolina who has done missionary work in Turkey for 23 years, was arrested as part of a sweeping crackdown on political opponents of President Recep Tayyip Erdogan. Despite his case being raised by U.S. officials at the highest levels, including President Donald Trump, he's now standing trial for terrorism and espionage.

Brunson faces up to 35 years in prison, and the judge ruled Wednesday that he continue to be held until October 12 -- a full two years since he was first detained.

Turkey has accused Brunson of working for the Gulenist movement, a political organization led by Fetullah Gulen, a Turkish cleric in exile in the U.S. whom Erdogan has accused of fomenting the coup. Gulen has denied the charge, and Brunson has repeatedly denied any involvement with Gulen in court and did again Wednesday.

President Trump had strong words Wednesday, tweeting that it is, "A total disgrace that Turkey will not release" Brunson and saying Erdogan "should do something to free this wonderful Christian husband & father. He has done nothing wrong, and his family needs him!"

Trump has had warm words for the Turkish leader that many critics see as increasingly authoritarian, especially after a power-grabbing referendum in 2017 that eliminated the role of prime minister and expanded the powers of the presidency. Trump was seen at the NATO summit walking and smiling with Erdogan, reportedly even giving him a fist bump at one point and telling him he does "things the right way."

The two leaders spoke on the phone Monday, according to Erdogan's office, whose readout of the call made no mention of Brunson's case or the other Americans. The White House did not provide its own readout.

Still, Secretary of State Mike Pompeo struck an optimistic tone Thursday that Brunson will be released soon.

"We're optimistic in the days and weeks ahead we'll get a good outcome for Pastor Brunson, his family, and frankly for many of those that are held in places around the world," Pompeo told the Christian Broadcasting Network Thursday.

His spokesperson denied that the administration has been softer on Turkey as it tries to woo the NATO ally away from the warmer relations with Russia and Iran that it has pursued.

"We continue to call on the Turkish government to quickly resolve his case in a timely and transparent and fair manner," Heather Nauert said Wednesday, notably not calling for his immediate release. When pressed on that, she added, "We always call for the pastor's release. We would certainly like that to happen."

The Trump administration has invested great focus and energy in Brunson's case, in part, because of his evangelical Christian faith -- shared by Pompeo and Vice President Mike Pence, who has raised Brunson's case as well.

"It's incredibly important that all faiths have the opportunity that every individual have the opportunity to practice faith in the way they want. It's central to my understanding of my religion; it's central to understanding my role as the secretary of state as well," Pompeo told CBN Thursday.

The top U.S. diplomat in Turkey was present for Brunson's hearing on Wednesday in Aliaga, a small coastal town in western Turkey near Izmir, where Brunson lived and worked for over two decades. There is no U.S. ambassador to Turkey, so charge d'affaires Philip Kosnett attended to show support for Brunson and his family, including wife Norine who was there as well.

At the hearing, Brunson smiled and waved at supporters, saying, "Thank you" in English, but nothing else. When he was in court in April, he said he had had a psychological breakdown and is now using anti-depressants, and he lost more than 50 pounds in prison, according to his lawyers.

Six senators introduced a bill Thursday to sanction Turkey until it ends the "the unjust detention" of nearly two dozen U.S. citizens. Specifically, the bill would direct the top U.S. executive at the World Bank and the European Bank for Reconstruction and Development to block future loans to Turkey, except for humanitarian purposes.

"Until Turkey begins acting like a NATO ally again, we will continue to pursue measures like sanctions and loan restrictions against them. We desire cooperation and strengthening ties between our countries, but the U.S. government has a responsibility to ensure the safety and welfare of its own people," Sen. James Lankford, R-Oklahoma, said in a statement, alongside fellow Republicans Sen. Thom Tillis of North Carolina and Senate Foreign Relations Committee chair Bob Corker of Tennessee and Democrats Sen. Jeanne Shaheen of New Hampshire, Bill Nelson of Florida, and Senate Foreign Relations Committee ranking member Bob Menendez of New Jersey.

In addition to Brunson, Turkey has detained more than a dozen U.S. citizens who are also Turkish citizens, including a NASA scientist who was convicted of being a member of a terrorist organization in February "without credible evidence," according to the State Department.

Serkan Golge was visiting Turkey with his family when the coup unfolded. He was arrested, charged with being a member of a Gulenist organization and spying for the CIA, and convicted and sentenced to seven years in prison.

Amid criticism that the U.S. has done little for these other Americans, Pompeo highlighted their cases Thursday in an interview with conservative radio host Hugh Hewitt, saying, "There are others being held in Turkey too that we're working hard on."

Turkish Foreign Minister Mevlut Cavusoglu said in May that it is the judiciary's decision whether Brunson will be freed. But President Erdogan has floated the idea of a swap in the past -- Brunson in exchange for Gulen, who is a legal permanent resident in Pennsylvania -- in a deal that critics decry as hostage negotiation by what should be a U.S. ally.