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

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

“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.

According to Martinez’s plea agreement, he began planning an attack against a military building, and confided those plans to an FBI confidential source.

Martinez said Muslims were being unjustly killed by the American military, and wanted to kill American soldiers until the country stopped its “war” against Islam, according to the plea.

The FBI source connected Martinez with his “Afghan brother,” who would help with the operation. The brother was an undercover FBI agent.

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 statement of facts. At the recruiting station, Martinez then tried to detonate an explosive that the FBI ensured was inert, authorities said.

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,” stated FBI Special Agent in Charge Richard A. McFeely.

Read more: The Post’s crime coverage