A suburban Indianapolis man accused of trying to join the Islamic State group overseas pleaded guilty to a terrorism charge Wednesday.

Akram Musleh of Brownsburg entered the plea in U.S. District Court in Indianapolis to a charge of attempting to provide material support to a foreign terrorist organization. He was 18 when he was arrested nearly two years ago at a Greyhound bus terminal in Indianapolis while he tried to board a bus to New York, where prosecutors alleged he was to fly to Morocco and on to territory controlled by the Islamic State.

The charge is punishable by a maximum sentence of up to 20 years in prison and a maximum fine of $250,000. Musleh's attorneys and prosecutors have not agreed on a specific sentence, a court document said. A sentencing date has not been set.

Musleh was remanded to the custody of U.S. marshals.

At the time of Musleh's arrest, FBI Special Agent Michele Denise Holley said in a 30-page criminal complaint that the man in May 2016 read an article about more than 8,000 potential terrorist targets in Indiana and then days later searched online for information about pressure cookers, which the court documents said could possibly be used to make an explosive device. He also searched for information on dynamite, flash powder and other explosive materials, Holley said.

Law enforcement made contact with Musleh and Brownsburg High School officials in 2013. The FBI identified him as someone who posted several videos featuring an al-Qaeda leader online, the complaint noted. Federal agents and school officials "took steps to dissuade Musleh from engaging in radical extremism," it said.

But nine months later, Musleh bought an Islamic State flag online and later photographed himself with it, the complaint said.