An Uzbek man living in the United States pleaded guilty on Friday in federal court in the southern state of Alabama to planning to kill US President Barack Obama.
Ulugbek Kodirov, 22, was arrested in an undercover operation while trying to obtain explosives and guns, the US Justice Department said in a statement.
US Attorney Joyce White Vance, who worked on the case, expressed "appreciation to the local community of Birmingham, which was instrumental in helping law enforcement shut down this threat."
Kodirov pleaded guilty to one count of providing material support to terrorist activity, one count of threatening to kill the president and one count of possession of a firearm by an illegal alien.
As part of his plea agreement, Kodirov admitted he had communicated "with an individual whom he believed to be a member of the Islamic Movement of Uzbekistan (IMU)," and that he "interpreted these conversations to mean that he should kill President Obama."
The US State Department considers the group a terrorist organization.
Kodirov also admitted to discussing with another person his desire to kill Obama and strategies for carrying out the assassination.
The other person -- who the Justice Department did not identify -- introduced Kodirov to an undercover US agent from whom the Uzbek man planned to purchase weapons.
They met in July 2011 at a motel in Leeds, Alabama. The agent showed Kodirov an M15-A1 machine gun, a sniper rifle with a telescopic lens and four disassembled hand grenades.
Kodirov chose the machine gun and hand grenades, but was arrested before he could leave the motel.
Kodirov entered the United States from Uzbekistan on a student visa in June 2009. His visa was revoked in 2010 when he failed to enroll in school, and he was living in an extended-stay Alabama motel when police arrested him.
Kodirov faces up to 30 years in prison on the charges.