ALEXANDRIA, Va. — In his brief but sensational sojourn in the Syrian civil war, Eric G. Harroun made a bit of a splash. He loaded Facebook and YouTube with scenes from the battlefield and gibes at the government of President Bashar al-Assad. In Web postings by both sides in the bloody conflict, he was “The American” — a former Army private from Arizona fighting with the Syrian opposition.

In mid-March, Syria Tube, a YouTube channel associated with the Syrian government, announced his death with a grisly video. “Terrorists, including American Extremist ‘Eric Harroun,’ Have Been Terminated,” the headline said. Mr. Harroun jauntily replied to an e-mail inquiry from Britain’s Mail Online: “Syrian Media must be smoking something,” the newspaper said he had answered, “because I am alive and well chilling in Istanbul having a martini at the moment.”

But in federal court here on Monday, it was clear just how drastically Mr. Harroun’s luck had turned. Prosecutors said Mr. Harroun, 30, who is accused of firing a rocket-propelled grenade while fighting alongside a designated terrorist group, might ultimately face charges carrying a minimum sentence of 30 years and a maximum of the death penalty. A judge declined to release him to home detention in his mother’s custody in Arizona, as the defense sought and a pretrial investigation proposed.

Magistrate Judge Ivan D. Davis said Mr. Harroun had “actively and knowingly participated in fighting with a group the U.S. has designated as a terrorist organization,” the Nusra Front, which the United States considers part of Al Qaeda’s branch in Iraq.