A federal magistrate judge will decide if a 19-year-old U.S. citizen from suburban Chicago accused of trying to travel to Syria to join Islamic State militants should stay behind bars pending trial.

Mohammed Hamzah Khan's detention hearing in federal court in Chicago Thursday follows his Saturday arrest at O'Hare International Airport as he attempted to board a plane to Turkey.

Prosecutors filed a motion Wednesday evening asking Judge Susan Cox to close part of Thursday's hearing to the public. Their explanation was itself sealed.

Investigators said Khan left a letter for his parents in his bedroom at the family's Bolingbrook home expressing disgust with Western society.

He's charged with attempting to provide material support to foreign terrorists. A conviction carries a maximum 15-year prison term.