PORTLAND, Maine — An 18-year-old charged with having homemade explosive devices in his backpack discussed plans to travel to Chicago to attack a mosque and other houses of worship, federal prosecutors said.

Xavier Pelkey, of Waterville, Maine, was in communication with two juveniles about his plans to attack a mosque, and possibly a synagogue, prosecutors said. A federal magistrate judge this week ordered him held without bail.

"It’s fair to say that based on the information that investigators received, that this was more than just talk," Assistant U.S. Attorney Craig Wolff said Thursday.

BOMB PLOT: NORTH CAROLINA MAN ACCUSED OF TEACHING OTHERS HOW TO MAKE IEDS MEANT FOR KILLING LAW ENFORCEMENT

Federal agents discovered three improvised devices in Pelkey's backpack during a search of his Waterville apartment on Feb. 11, according to documents filed in U.S. District Court.

The devices were made of fireworks bundled together with staples, pins and thumb tacks to create shrapnel if detonated, an FBI agent wrote.

An 18-year-old charged with having homemade explosive devices in his backpack discussed plans to travel to Chicago to attack a mosque and other houses of worship, federal prosecutors said. (FBI)

Pelkey is charged with possession of an unregistered destructive device, a felony that carries a sentence of up to 10 years in prison.

His attorney, Christopher MacLean, didn't immediately return a message Thursday from The Associated Press.

(Getty Images)

Details of the discussion about committing what the prosecutor described in court as "mass murder" at houses of worship are included in a sealed court document, Wolff said. He said he could confirm only what was said in court at Tuesday's detention hearing.

The Council on American-Islamic Relations urged federal prosecutors to bring hate crimes charges in the case.

CLICK HERE TO GET THE FOX NEWS APP

"This disturbing case highlights the real threat posed by anti-Muslim bigotry, antisemitism and other forms of hate," Edward Ahmed Mitchell, CAIR's deputy director, said in a statement.

Council on American-Islamic Relations (CAIR) national executive director Nihad Awad speaks during a news conference at the Council on American-Islamic Relations (CAIR), Monday, Jan. 30, 2017, in Washington. The group announced the filing of a federal lawsuit on behalf of more than 20 individuals challenging an executive order signed by President Donald Trump. (AP Photo/Alex Brandon)

Council on American-Islamic Relations (CAIR) national executive director Nihad Awad speaks during a news conference at the Council on American-Islamic Relations (CAIR), Monday, Jan. 30, 2017, in Washington.  (AP Photo/Alex Brandon)

Wolff declined to comment on whether more charges could be forthcoming.