BALTIMORE - A 21-year-old construction worker who had recently converted to Islam and told an FBI informant he thought about nothing but jihad was arrested yesterday when he tried to detonate what he thought was a bomb at a military recruiting center, authorities said.

Antonio Martinez, a naturalized U.S. citizen also known as Muhammad Hussain, faces charges of attempted murder of federal officers and attempted use of a weapon of mass destruction.

The bomb he is accused of trying to detonate was fake and had been provided by an undercover FBI agent. It was loaded into an SUV that Martinez parked in front of the recruiting center, authorities said, and an FBI informant picked him up and drove him to a nearby vantage point where he tried to set it off.

It's the second time in less than two weeks that a young man has been arrested for allegedly trying to detonate what he thought was a bomb during a sting operation.

"There was never any actual danger to the public during this operation this morning," U.S. Attorney Rod Rosenstein said yesterday after a hearing in U.S. District Court in Baltimore.

Martinez was ordered held for a hearing Monday.

According to court documents, he has been on the FBI's radar screen since October, when he told a confidential FBI source he wanted to attack and kill military personnel. Investigators believed that Martinez posed a genuine threat and that he came up with the plan by himself.

"The investigation was undertaken only because experts had made the determination that there was a real risk," Rosenstein said.

The case is similar to one in Portland, Ore., where authorities said they arrested a Somali-born teenager the day after Thanksgiving after he used a cell phone to try to detonate what he thought were explosives in a van. He intended to bomb a crowded downtown Christmas tree-lighting ceremony, but the people he had been communicating with about the plot were FBI agents.

After Martinez found out about that case, he called the FBI informant he had been plotting with. "I'm not falling for no b.s.," court documents quote him as saying.

But he ultimately decided to continue with the plot.