A Somali-American teenager from Inver Grove Heights pleaded guilty in federal court Thursday to conspiring to join terrorists fighting in the Middle East.

Abdullahi Yusuf, 18, is the first defendant to plead guilty in the FBI's long-running investigation of Minnesotans who have tried to enlist or fight with forces aligned with the Islamic State in Iraq and the Levant (ISIL).

Last May, Yusuf was stopped by FBI agents as he tried to board a flight bound for Turkey at Minneapolis-St. Paul International Airport.

On Thursday, Yusuf admitted to Chief U.S. District Judge Michael Davis that before his arrest he had made plans to join up with a friend, Abdi Nur, in Turkey. From there, he said, the pair planned to make their way to fight with ISIL. He also acknowledged that in spring of 2014 he attended Islamist meetings in Minneapolis and started making plans to flee the country.

Yusuf's case took an unusual twist early this month when Davis agreed with Yusuf's attorney to place him in a halfway house pending being directed to a court-backed counseling program designed to turn him away from radicalization. A sentencing date has not been set.

The day after Yusuf was stopped from boarding his flight, Nur was able to elude authorities and fly out of the Twin Cities. He is believed to be fighting in the Middle East. He is wanted on federal charges alleging that he conspired to work with terrorists.