The Baltimore man who plotted to attack an Armed Forces recruiting station because he thought the U.S. was “waging war” against Islam was sentenced Friday to 25 years in prison.

Antonio Martinez, a U.S. citizen who converted to Islam and began using the name Muhammad Hussain, had pleaded guilty in January to attempting to use a weapon of mass destruction against federal property. Martinez admitted he tried to detonate what he thought was a working car bomb at a Catonsville recruiting station in December 2010.

“Mr. Martinez was sentenced today and fully accepted responsibility for his acts,” his lawyer, Maryland Deputy Federal Public Defender Joseph A. Balter said. “He made a statement to the court in which he renounced violence and terrorism.”

The FBI first learned of Martinez’s radical leanings through his Facebook postings, then had an undercover agent join his plot and supplied him with a fake car bomb, federal officials said.

During conversations with a confidental informant and the undercover agent, Martinez “spoke about his anger toward America, his belief that Muslims were being unjustly targeted and killed by the American military and his desire to commit jihad to send a message that American soldiers would be killed unless the country stopped its ‘war’ against Islam,” according to his plea agreement.

Martinez tried unsuccessfully to recruit others to his cause, and later agreed to meet with the informant’s “Afghani brother,” an undercover FBI agent who supplied him with the fake car bomb, according to court papers.

On December 8, 2010, Martinez said he met the informant and they drove to a parking lot near the recruiting center. In the car, the informant filmed Martinez vowing to “fight against the oppressors until those who waged war with Islam stopped their actions,” according to the plea agreement. Martinez drove the car to the front of the recruiting center, then left with the informant and tried to detonate the bomb.

During the hearing in U.S. District Court in Baltimore, Judge J. Frederick Motz also ordered Martinez to serve five years of supervised release after his prison term ends.

“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 Rod J. Rosenstein, U.S. Attorney for the District of Maryland.