An Alexandria man who plotted to carry out a suicide bombing at the U.S. Capitol, using what he thought were explosives supplied by al-Qaeda, was sentenced Friday to 30 years in prison.

Amine Mohammed El Khalifi, an illegal immigrant from Morocco, had pleaded guilty in June to a charge of attempting to use a weapon of mass destruction against federal property.

This artist rendering shows Amine El Khalifi before U.S. District Judge T. Rawles Jones Jr. on Feb. 17, 2012, in federal court in Alexandria. (Dana Verkouteren/AP)

Khalifi was arrested in February heading to the Capitol with what he thought was an explosives-laden vest and a loaded gun. Undercover FBI agents had provided both weapons, which were rendered inoperable.

“Mr. Khalifi wanted to be the first suicide bomber in U.S. history and he wanted to blow up the iconic Capitol building,” Neil H. MacBride, U.S. Attorney for the Eastern District of Virginia said after the hearing. “Thank God it was the FBI that discovered Mr. Khalifi and not the terrorists.”

Kenneth P. Troccoli, one of Khalifi’s attorneys, told the judge that his client’s motivation “was simply doing what he thought God called him to do.”

“He had no hatred against the United States,” Troccoli said.

Authorities have said an informant tipped them off about Khalifi after he attended a January 2011 meeting where he allegedly expressed agreement with another attendee that the “war on terrorism” was a “war on Muslims” and that the group needed to be ready for war.

Khalifi was later introduced to an FBI agent posing as an armed extremist, authorities said. They have said he was considering other targets including a synagogue, a restaurant and an office building.

Khalifi had come to the United States when he was 16, but overstayed his visitor’s visa for years, authorities have said.