BIRMINGHAM, Ala. - A federal judge sentenced an Uzbek man living illegally in the United States to nearly 16 years in prison on Friday on terrorism and weapons charges stemming from his plot to kill President Barack Obama.

Ulugbek Kodirov, who arrived in the United States in 2009 to attend medical school but never enrolled, had plotted to shoot Obama while the president campaigned for re-election this year, according to federal authorities in Alabama.

They said the 22-year-old man became "radicalized" through Internet research and believed he was acting on behalf of an Islamist terrorist group in his homeland.

"This case is an example of how our youth can be radicalized by misinformation and propaganda they see on the Internet," Assistant US Attorney Michael Whisonant said during a sentencing hearing in Birmingham.

Kodirov apologized at the hearing. He avoided a potential life sentence by cooperating with authorities and pleading guilty in February to providing material support for terrorist activity, being an illegal alien in possession of a firearm and threatening to assassinate the president.

US District Judge Abdul Kallon sentenced him to 188 months in prison.

"We need to send a strong message that anyone who subjects themselves to propaganda, that the punishment will be serious," Kallon said.

Federal authorities said Kodirov believed he was acting on behalf of the Islamic Movement of Uzbekistan, an Islamist terrorist group the United States has designated as a foreign terrorist organization.

Kodirov's student visa was revoked in April 2010 after he failed to enroll in school, investigators said. His attorney said Kodirov's English skills were too poor for him to be admitted and called him a "lonely young man with a laptop."

Kodirov was arrested in July 2011 at an Alabama motel where he had obtained a fully automatic machine gun and four hand grenades from an undercover agent. Officials said he planned to use the weapons to kill the president.

"One of the biggest terrorist threats we face is the lone wolf," US Attorney Joyce White Vance said after the hearing.

Please LIKE our Facebook page - it makes us stronger