Serkan Golge worked at NASA's Johnson Space Center. (File)

Former NASA scientist Serkan Golge was suddenly released from prison in Turkey this week after spending nearly three years behind bars on terrorism charges - an arrest stemming in part from his possession of a single dollar bill.

The State Department, which has long described the terrorism accusations against Golge as unjust and unsupported, confirmed his unexpected release Wednesday hours after a phone call between President Trump and Turkish President Recep Tayyip Erdogan.

The 39-year-old physicist, a dual Turkish and American citizen, had been arrested in the summer of 2016 while visiting family in Turkey, swept up in a massive dragnet by Turkish authorities in the aftermath of the failed coup seeking to overthrow Erdogan.

Golge was one of more than 110,000 people, including at least nine American citizens and several US Consulate employees, detained during the crackdown by the Turkish government on suspicion of participating in the failed coup attempt in July 2016, according to the US Helsinki Commission, an independent federal body focused on regional security and human rights overseas. He was convicted on what the commission described as apparent false terrorism charges without due process and sentenced to seven-and-a-half years in prison in February 2018, a sentence that was later reduced to five years.

White House and State Department officials have so far not provided any detail about what led to his release. Trump thanked Erdogan while speaking to reporters on the White House lawn Thursday, saying he hoped Golge would be able to return home soon. Golge, however, told NBC News that the conditions of his probation won't allow him to leave Turkey for now.

"My family and I, we haven't been happy for a very long time. But after my release, at least I can now say that there's a light at the end of the tunnel," he said Thursday.

Turkish authorities detained Golge on the morning of July 23, 2016, just as he was leaving his family's home for the airport to return to Houston, where he worked at NASA's Johnson Space Center. Based on a tip, the Turkish officers claimed that Golge was connected to the organization that Erdogan blamed for the coup attempt, describing the Gulen movement as a terrorist group, according to the commission.

After police searched the home two separate times, they finally emerged with a single US dollar bill - the evidence authorities seized to claim that Golge was connected to the failed coup and the Gulen movement. The group's leader, Fethullah Gulen, lived in Pennsylvania.

"One day you're a NASA scientist's wife, the next you're an accused terrorist's wife," Golge's wife, Kubra, told the Houston Press in a 2017 interview. "It's insane."

Erdogan accused Gulen, his former ally, of staging the coup attempt within hours of the violent insurrection on July 15, 2016. Gulen - an Islamic scholar who supported Western ideas and had established numerous schools in Turkey, the United States and elsewhere - denied involvement from the beginning and disputed Erdogan's assertion that his supporters were part of a terrorist organization.

Turkish officials believed Gulen gave "blessed" American dollar bills to his followers, and believed that Turks in possession of the US currency could be connected to Gulen, according to the commission. Throughout Turkey, the commission reported, the dollars were presented at national security trials as proof of terrorism in the cases of countless Turkish nationals and others, suspected of participating in the coup.

At Golge's trial, it was no different.

Along with the dollar bill, Turkish authorities claimed that Golge's US passport and his college degree at a Gulen-affiliated university in Turkey proved that he was a Gulenist, despite attending the school on a government scholarship, according to the commission. The Houston Press also reported that his NASA ID card was also used against him as evidence.

The tip, the commission said, came from one of Golge's relatives who had a dispute with him over a family inheritance: The relative claimed Golge worked as a spy for the CIA.

In fact, Golge worked at Johnson Space Center, where he researched the effects of solar radiation on astronauts in space. He lived in a southwest Houston suburb with his wife and two young children, and had moved to the United States in the early 2000s to study physics at Old Dominion University in Norfolk. Both he and his wife, Kubra, became naturalized US citizens in 2010, according to the Press.

Golge's detention and that of the other American citizens, including pastor Andrew Brunson, strained the relationship between the United States and Turkey as the State Department worked to secure their release.

Like Golge, Brunson was also accused of aiding terrorism and being connected to Gulen. Amid tense negotiations for his release last year, Trump imposed economic sanctions on Turkey last August, doubling US tariffs on Turkish steel and aluminum. The financial blow came after Erdogan apparently reneged on a deal to free Brunson, as both presidents accused the other of bad faith. Trump eventually lifted the sanctions following Brunson's release in October.

Trump invited Brunson to the White House that month as his evangelical base celebrated the pastor's freedom after two years wrongfully imprisoned. But so far Golge's release has been less high-profile.

State Department spokeswoman Morgan Ortagus announced Golge's release at a press briefing Wednesday, saying, "We will continue to provide all appropriate consular services to Mr. Golge, including making sure he can return home as soon as possible." But she said she could not share any further details.

Trump said Thursday that he and Erdogan "dealt with" Golge's release, and that "it was great." But he did not name Golge throughout his brief comments.

"They released this prisoner, hostage - whatever you want to call him," Trump said. "He's at home custody, in Turkey. He'll be released fairly soon, so that's good news."

A White House spokesman confirmed Trump was referring to Golge, but did not answer questions related to Trump's phone call with Erdogan or the terms of Golge's release, referring questions to the State Department. The State Department did not immediately respond to a request for comment late Thursday.

It's unclear how long Golge must remain on probation in Turkey, where his wife and children live, or if US officials can negotiate a swifter return. He told NBC News he must check in with local police three times per week.

"The only thing I want right now is to be able to go back to the United States and start working at NASA again as a scientist,," he said.