CHICAGO — In a rare move for terror cases, a federal judge agreed Thursday to release on home confinement an Illinois teenager charged with seeking to travel abroad and join an Al Qaeda-linked militant group in war-torn Syria.
Abdella Ahmad Tounisi, 18, of Aurora, was arrested at O’Hare International Airport last month as he allegedly prepared for the first leg of a trip to join Al Qaeda-affiliated Jabhat al-Nusrah, which is fighting the regime of Syria’s president, Bashar Assad.
In arguing for continued detention, prosecutors also noted Thursday that Tounisi had allegedly spoken with a friend of his last year about bombing targets in Chicago. Tounisi is not charged in that case, though the friend, Adel Daoud, was and is in jail awaiting trial.
After announcing his surprise ruling, US magistrate judge leaned forward on his bench, telling the teen he should take the case seriously.
‘‘This is no game, Mr. Tounisi. OK?’’ Judge Daniel Martin told him.
The slight, short Tounisi stood before the judge in orange jail garb and slippers, flanked by US marshals. About 30 friends and relatives sat on spectator benches; several cried after the judge ruled.
After ruling, the judge stayed his own order for 24 hours to give prosecutors a chance to appeal, which they announced later Thursday they would do. A hearing in the matter was set for Friday.
Approving the release of anyone accused on terrorism charges is uncommon, said Phil Turner, a former federal prosecutor and now private attorney in Chicago.
‘‘It’s incredibly extraordinary,’’ he said. ‘‘It’s usually a different realm with terrorist suspects.’’
Pressure on a judge to hold a terrorist suspect would be all the greater now, said Turner, following the Boston Marathon bombings.
Judge Martin said repeatedly his decision to grant Tounisi release was a close call.