An Alexandria man was sentenced to 30 years in prison Friday for plotting a suicide bombing at the U.S. Capitol using explosives he thought were given to him by al-Qaeda.

Amine Mohammed El Khalifi, 29, was arrested in February as he headed toward the Capitol with what he believed were an explosive-laden vest and an automatic weapon. But the material had been made inoperable by undercover FBI agents.

He pleaded guilty in June to a charge of attempting to blow up a federal institution using a weapon of mass destruction. He will be deported to Morocco after completing his sentence, because he was in the country illegally.

Khalifi expressed no remorse for the plot as he stood before U.S. District Judge James Cacheris in federal court in Alexandria on Friday. He had a bushy beard and thick glasses.

“I just want to say, ‘I love Allah,’ that’s it,” Khalifi told the courtroom.

This artist rendering shows Amine Mohammed El Khalifi before U.S. District Judge T. Rawles Jones Jr. in February. (Dana Verkouteren/AP)

Prosecutors described an evolving terrorist plot that gradually grew in scope as Khalifi worked with the two undercover FBI agents he believed were al-Qaeda operatives. They said Khalifi originally planned to bomb an Alexandria building that he believed housed military offices, before considering other targets that included a D.C. restaurant, a synagogue and the house of a general.

He finally settled on the Capitol and began preparations with the help of the undercover agents. At one point, prosecutors said Khalifi detonated a test explosive at a West Virginia quarry, telling an undercover agent he wanted a bigger explosion. He also told them he wanted a gun to shoot any police officers who might stop him from entering the Capitol.

On Feb. 17, Khalifi and two undercover agents drove to a parking garage near his target. Khalifi was given the inoperable explosive-laden vest and a Mac 10 automatic weapon, and he began heading toward the Capitol. But he was arrested before he could leave the garage. Federal officials said there was never any danger to the public.

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

Prosecutors said Khalifi came to their attention after a “terrorist facilitator” in Afghanistan posted a message on his Facebook account in 2010 asking those who wanted to join the mujaheddin to contact him. Prosecutors said Khalifi replied to the message, although Khalifi said in court documents that he does not remember the exchange.

Kenneth P. Troccoli, Khalifi’s attorney, told the judge that his client’s motivation “was simply doing what he thought God called him to do,” and he was relieved the plot failed and no one was hurt.

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

He said Khalifi had gone through an unlikely transformation from a drug-using music producer on the D.C. club scene to a radicalized Muslim. He said Khalifi arrived in the United States at 16 and attended school in Florida before moving to Northern Virginia.

He held odd jobs, before getting into cocaine and the designer drug ecstasy and producing music. In 2007, he was convicted of assault for an altercation at a club and decided it was time to change his life.

Khalifi became a devout Muslim and gave up drugs and drinking. He became increasingly concerned about the treatment of Muslims overseas and began watching radical Islamic videos on the Internet.

Troccoli said the FBI agents did not entrap Khalifi but made the plot possible. He said they gave Khalifi $4,300 for rent and agreed to financially support his parents back home after the suicide bombing in their guise as al-Qaeda agents.

“These agents being so willing and able . . . ultimately helped Mr. Khalifi go forward with this attack,” Troccoli said.