KANSAS CITY, Kan. — A Kansas man who tried to set off what he thought was a bomb at an Army post to support the Islamic State group was sentenced Monday to 30 years in federal prison.

John T. Booker Jr., 22, of Topeka, was arrested in April 2015 outside Fort Riley, about 60 miles (100 kilometers) west of Topeka, as he tried to arm what he thought was a bomb. When he pleaded guilty in February, he acknowledged that he wanted to kill Americans and participate in jihad to support the Islamic State group.

Booker intended to detonate the bomb, which he believed contained 1,000 pounds of ammonium nitrate, and die in the process, prosecutors said. The device was an inert device built by FBI informants he had been meeting with to plan the plot.

Booker was arrested outside the fort when he made the final connections on the device that he believed would arm the bomb. Fort Riley is the home of the Big Red One, the Army’s 1st Infantry Division.

In a video he made for Americans to see after his planned death, Booker said “You sit in your homes and think this war is just over in Iraq. Today we will bring the Islamic State straight to your doorstep.”

Booker pleaded guilty in February to one count of attempting to use a weapon of mass destruction and one count of attempting to destroy government property with an explosive device. The plea agreement recommended the 30-year sentence. A conviction on the weapons-of-mass-destruction charge could have led to life in prison.

As part of the plea deal, prosecutors dropped a charge of attempting to provide material support to the Islamic State group.

“If Mr. Booker had been successful in detonating a car bomb, the results could have been dozens, if not hundreds, of casualties,” FBI Special Agent in Charge Darrin Jones said in a statement. “The FBI and our law enforcement partners remain committed to protecting the citizens of the United States and thwarting acts of terrorism.”

Booker’s attorneys had said at past hearings that he was diagnosed with bipolar disorder and was taking medication.

The FBI began investigating Booker in March 2014 after he posted pro-jihad comments on Facebook. Prosecutors said he tried to enlist in the U.S. Army to attempt an insider attack against American soldiers but his enlistment was denied. In March 2015, he made a video in which he pledged allegiance to Abu Bakr al Baghdadi, the leader of ISIS, prosecutors said.

Another Topeka man, Alexander Blair, was sentenced in October to 15 months in prison for conspiracy after he admitted he loaned Booker $100 to store what they thought was the explosive device. Blair’s attorney argued that Blair had an unusual genetic condition called Williams syndrome that made Blair “susceptible” to being manipulated by Booker.