A Baltimore man pleaded guilty Thursday to trying to blow up a Catonsville military recruiting station.

Antonio Benjamin Martinez, 22, was arrested on Dec. 8, 2010 after he attempted to detonate what he believed to be explosives at the armed forces recruiting station near Baltimore.

According to Martinez’s plea agreement, he was a recent convert to Islam when he began planning an attack against a military building. He confided those plans to an FBI confidential source, saying Muslims were being unjustly killed by the American military.

He said he wanted to kill American soldiers until the country stopped its “war” against Islam, according to the plea agreement. He also posted militant beliefs on his Facebook page.

After he unsuccessfully tried to involve several people in his plot, the FBI source connected Martinez with his fictitious “Afghan brother,” who would help with the operation. The brother was an undercover FBI agent.

After meeting with him, Martinez said the brother was the “answer to his prayers,” according to the plea agreement.

On the day of the planned attack, Martinez had the FBI informant record him on a camcorder saying he would continue to fight those who waged war with Islam, according to the plea agreement. At the recruiting station, Martinez then tried to detonate a fake bomb given to him by the FBI, authorities said.

Martinez later told authorities that the bomb was intended to kill military service members who worked in the building.

“We are catching dangerous suspects before they strike, and we are investigating them in a way that maximizes the liberty and security of law-abiding citizens,” said Maryland U.S. Attorney Rod J. Rosenstein.

Martinez, who pleaded guilty to attempted use of a weapon of mass destruction against federal property, faces 25 years in prison when he is sentenced April 6.

“This is an example of another successful prosecution that resulted from outstanding partnerships between the Muslim community and law enforcement,” said Richard A. McFeely, FBI special agent in charge.