A 20-year-old US citizen has been charged with attempting to explode a car bomb at Fort Riley in Manhattan, Kansas.
John T Booker Jr was making final preparations to carry out the suicide attack on behalf of the Islamic State (IS), the FBI said.
Mr Booker previously had tried to join the Army, but was denied entry because of internet posts about “jihad”.
Authorities say that US personnel were never in danger.
Booker enlisted in the military “with the intent to commit an insider attack against American soldiers,” according to the FBI complaint.
He had “formulated several plans for committing jihad once enlisted”, including shooting soldiers on the firing range and kidnapping a high-ranking officer.
He told an undercover FBI informant that he wanted to show that “we will be coming after American soldiers in the streets… we will be picking them off on by one.”
On 10 March, Mr Booker and an FBI informant travelled to Freedom Park near Fort Riley to film a martyrdom video, according to the FBI complaint.
The video begins with Mr Booker, who was a military recruit at the time, proclaiming his loyalty to Abu Bakr al-Baghdadi, the leader of IS.
By 24 March he was told that he would not be permitted to join the military, and was questioned by FBI agents regarding Facebook posts declaring his sympathies for Islamic militants.
After being denied entry to the military, the FBI said that he and an undercover agent formulated a plan to build and detonate a truck bomb at Fort Riley, which is a base near his home in Topeka, Kansas.