A 26-year-old ISIS supporter who planned a mass shooting in Tampa, Florida, was sentenced this week to 18 years in prison and a lifetime of supervised release in a plea deal, the Justice Department said. 

Judge Thomas Barber on Thursday called Muhammed Momtaz Al-Azhari a "danger to the United States and its citizens. We must be protected from him for life."

Al-Azhari, a U.S. citizen, pleaded guilty in February to attempting to provide material support to a designated foreign terrorist organization.

The FBI began investigating him in 2018 after he was released from a Saudi prison and sent back to the U.S. He had been imprisoned in Saudi Arabia for supporting terrorism in Syria. 

NEW YORK MAN WHO ACTED AS ISIS RECRUITER SENTENCED TO LIFE IN PRISON 

Muhammed Momtaz Al-Azhari's mugshot

Muhammed Momtaz Al-Azhari pleaded guilty in February to attempting to provide material support to ISIS.  (FOX 13)

He began planning the Tampa attack in the spring of 2020, scouting locations for the massacre, obtaining weapons, including a fully automatic rifle, and rehearsing parts of his plan. He also rehearsed what he would say after the attack about his support of ISIS, the DOJ said in a release. 

Al-Azhari also spoke about avenging the imprisonment of Muslims and ISIS fighters and retaliation for the U.S. military’s presence in the Middle East. 

"The government made a clear case," attorney Anthony Rickman told FOX 13. "This individual is a terrorist and extremist, somebody with the intent to cause mass murder in this country and in our own backyard." 

AT LEAST 41 WERE KILLED IN AN ISLAMIC EXTREMIST ATTACK AT UGANDA SCHOOL 

A ISIS soldier and flag

The Islamic State terror group, also known as ISIS or ISIL, was formally defeated in Syria in 2019. (Pictures from History/Universal Images Group via Getty Images, File)

In texts released by the FBI, Al-Azhari alluded to the 2016 Pulse nightclub shooting in which a gunman killed 49 people in Orlando, writing, "I don’t want to take four or five, no. I want to take at least 50."

In another text he wrote, "You know, like brother Omar Mateen in Orlando did. He took 49 with him." Mateen was killed during the shooting. 

Al-Azhari was recorded during several conversations in April and May of 2020 with an undercover FBI agent and a confidential source, during which he told the source he planned to provide material support for ISIS and send the terrorist organization money. 

He also tried to buy weapons from the undercover agent. 

He also recruited the source for his planned attack, asking him to get a Glock pistol and an unregistered silencer. 

CLICK HERE TO GET THE FOX NEWS APP

He was finally arrested on May 24, 2020, after he took possession of the gun from the source.