BIRMINGHAM, Ala. (AP) — An Uzbek man who once worked at a shopping mall in Alabama was sentenced Friday to more than 15 years in prison for plotting to kill President Barack Obama.

U.S. District Judge Abdul K. Kallon imposed the sentence Friday on Ulugbek Kodirov, 22. He had faced up to 30 years in prison.

Defense attorney Lance Bell argued that Kodirov — who had the equivalent of a nursing degree in his native country before he moved first to New York and then Alabama — had accepted responsibility for his actions and was trying to straighten out his life. He said Kodirov wasn't "a big, bad terrorist."

"I'm not calling him a victim, but he's a victim to a degree of social media," Bell said.

Assistant U.S. Attorney Michael Whisonant said Kodirov would have tried to kill Obama and a foreign group would have taken credit if he had not been arrested a year ago.

"This case is an example of how our youth can be radicalized by the propaganda and lies on the Internet," Whisonant told the judge.

Kodirov pleaded guilty in February to threatening to kill the president, providing material support to terrorism and unlawfully possessing a firearm. He said he came up with the plan to kill Obama as he campaigned for re-election after communicating over the Internet with a man he believed to be a member of an Uzbek Islamic group the United States classifies as a terrorist organization.

Members of the Islamic community in Birmingham helped in the case against Kodirov, prosecutors said.

With limited proficiency in English, Kodirov worked seven days a week in a kiosk at a large shopping mall in the Birmingham suburb of Hoover before his arrest, the defense said.

A complaint said Kodirov contacted an unidentified person trying to buy weapons in early July 2011, and that person became a confidential source for the government. Accompanied by the witness, Kodirov purchased a Sendra M115A1 automatic rifle from an undercover agent at a Birmingham-area motel and made a final threat against the president, authorities said. The agent also gave Kodirov four hand grenades with the powder removed.

Authorities said Kodirov was in the country illegally because he obtained a student visa but never enrolled in school. He faces deportation after his release.

The defense argued Kodirov was lonely and turned to the Internet for entertainment and companionship after moving to Alabama, where few people speak his native language. He was able to communicate with other believers in Islam over his laptop computer, they said.

A sentencing memorandum submitted by his defense attorney said Kodirov began viewing jihadist websites and YouTube videos. After communicating with Muslim men, "came to the belief that Americans were killing his people in cold blood."

"Ulugbek then developed an anti-American attitude along with losing trust in Americans," said the document. Kodirov's beliefs changed after his arrest when he learned when he learned stories he had been told were lies, Bell argued.

Located in central Asia, Uzbekistan and was once part of the former Soviet Union. It is slightly larger than California and the vast majority of its population is Muslim.

Islamic terrorists have been linked to sporadic violence in the country for more than a decade, according to the State Department.

BET National News - Keep up to date with breaking news stories from around the nation, including headlines from the hip hop and entertainment world. Click here to subscribe to our newsletter.