To the Kurdish peshmerga forces patrolling northern Iraq in March 2016, Mohamad Khweis looked for all the world like an Islamic State suicide bomber. They certainly didn't peg him as a bus driver from the wealthy suburbs of Washington, D.C.

As they saw him approach from the stretch of no-man's land separating the Islamic State from Kurdish-controlled sections of Iraq, they fired warning shots in the air. They ordered him to strip to his underwear. They confiscated his cash and his canned fish, thinking it might be a bomb.

CAPTURED AMERICAN ISIS FIGHTER SAYS, 'I WAS NOT THINKING STRAIGHT'

They were surprised to find out he was an American, carrying a Virginia driver's license. U.S. officials were surprised as well — they had no idea Khweis had left Virginia to travel to the Islamic State.

Now Khweis, 27, is scheduled to go on trial Tuesday in federal court in Alexandria, Virginia, for providing material support to a terrorist organization.

While more than 100 Americans have been charged with terror-related offenses connected to the Islamic State, most have been charged in sting operations, where the defendant only thought he had made a connection to the Islamic State.

Khweis is among a small number of Americans who actually made it to the Islamic State, and then fled after realizing they had made a mistake.

Khweis told Kurdish television that life in Mosul was difficult and "I found it very, very hard to live there." He noted that there was no smoking and compulsory religion classes.

Khweis grew up in northern Virginia and graduated from Edison High School in Fairfax County in 2007. According to court records, he served as a bus driver for the region's Metro system.

In 2015, he left the U.S. for Europe. After stops in London and the Netherlands, he arrived in Turkey, and Islamic State facilitators smuggled him across the Syrian border to Raqqa, prosecutors say.

In Raqqa, the Islamic State's capital, prosecutors say Khweis went through a formal intake process, in which he indicated his willingness to serve as a suicide bomber, prosecutors say. He was then sent to live in Mosul, where he spent several weeks taking lengthy classes in Islamic law.

He spent three months in the Islamic State, and Khweis' lawyers say he tried several times to escape. Finally, he was able to escape after an all-night hike from the Iraqi town of Tal Afar. He walked for miles before reaching a Kurdish military checkpoint near Sinjar mountain.

The Kurdish captain who arrested Khweis testified at a pretrial hearing about the arrest.

"We thought he might be a suicide bomber," the peshmerga official testified through an interpreter. "Anyone before who approached us would blow themselves up."

Many details of Khweis' case emerged in a pretrial hearing in which his defense lawyers sought unsuccessfully to have his confession tossed out of court. The defense lawyers argued that U.S. authorities abused a common practice in interrogating terrorism suspects. Authorities will often conduct separate interrogations, beginning with intelligence interviews. The subject's right to remain silent is not explained to him. After those interviews are concluded, a second "clean team" of interrogators will re-question the suspect, reading him his rights and intending to use the information in a criminal prosecution.

The defense contended that the intelligence interrogators deliberately molded Khweis' answers into something that could be exploited by the clean team. At one point, the intelligence interrogator wrote in an email that Khweis was "lined up perfectly for the clean team."

Defense lawyer John Zwerling said Khweis was desperate to return to the U.S. after spending weeks in a Kurdish prison, even if it meant facing criminal charges in the U.S. He said the FBI interrogators exploited that, suggesting that Khweis needed to incriminate himself sufficiently so that prosecutors would bring charges and seek his extradition.

Prosecutors acknowledged that the emails discussing Khweis being lined up for a criminal interrogation are unfortunate, but said Khweis was eager to talk.

In the pressure of a terror investigation "sometimes you don't say things with a queen's English precision," prosecutor Dennis Fitzpatrick said.

Ultimately, prosecutors say, Khweis was more than willing to talk about joining the Islamic State and agreed to be interviewed even after being informed that his family had hired a lawyer for him.

"This is a defendant who simply wanted to talk," said prosecutor Raj Parekh. "He wants his story to get out there. He wants his time with ISIS to be known."