Washington (CNN) -- A former U.S. soldier accused of fighting with terrorists against Syrian forces pleaded guilty to a lesser charge and was released from custody.
Eric Harroun was sentenced to time served by a federal judge in Alexandria, Virginia, on Thursday.
Court documents showed he pleaded guilty to an export charge involving conspiracy to transfer defense articles and services.
The Phoenix man entered into a plea agreement with the government which remains under seal.
Harroun was arrested in March and charged with conspiring to use a rocket propelled grenade while fighting with the al-Nusra Front, an alias name for the terrorist group al Qaeda in Iraq.
If convicted of that charge, he faced a possible sentence of 30 years to life.
Harroun allegedly posted videos on the Internet showing him with weapons.
At a court hearing the next month, a federal prosecutor took the unusual step of revealing Harroun had been on a "no-fly" list and had been removed so he could fly from Turkey to the United States where he was arrested.
This allowed U.S. authorities to take custody of Harroun without asking Turkey to arrest him and hand him over.
The prosecutor did not say how long Harroun had been on the "no fly" list or whether he was aware of it.
FBI agents observed him during the flight although he was not taken into custody until after he arrived in the United States. It's also not clear whether Harroun's name is back on the list.
According to an FBI affidavit made public at the time of his arrest, Harroun crossed into Syria in January where he received training from the al-Nusra Front on how to use rocket propelled grenades and posted still photos and videos of himself on the Internet handling the RPGs and other weapons.
The FBI interviewed him three times in Istanbul about his activities before he flew to the United States.
The case appeared to present the United States with a thorny problem -- Harroun allegedly was fighting against the Syrian government which the United States also opposes. But the United States considers the al-Nusra Front a terrorist group.
At the April hearing, federal public defender Geremy Kamens noted an FBI agent who testified said there was no evidence Harroun was involved in any terrorist activities.
Harroun served in the Army from 2000 to 2003.