Updated

An Uzbek man, who was living illegally in the U.S., was indicted Tuesday by a federal grand jury for allegedly making multiple threats to assassinate President Obama, then gaining possession of explosive material and a machine gun.

Ulugbek Kodoriov is accused of making four threats against Obama from July 9 to 13, the indictment says. Kodoriov, who lived in Jefferson County, Ala., eventually gained possession of a Sendra Corporation Model M15-A1 rifle, which was illegal because of his immigration status, according to the indictment. He also allegedly obtained an explosive intended for use as a grenade.

He was residing at the Oak Mountain Lodge in Birmingham, according to a search warrant obtained by FoxNews.com. Authorities sought any information in his room regarding Obama, as well as sniper rifles, documents relating to assassinations and Jihadist manuals.

On July 9, Kodoriov contacted an FBI source and asked about ways to kill the president by a long-range shot, according to the warrant. Kodoriov allegedly inquired about sniper rifles and said he didn’t care if he lost his life in an assassination attempt.

Kodoriov, 21, is a strict Muslim from Uzbekistan who previously supported Islamic extremists, an FBI source said, according to the warrant.

The Justice Department, in announcing the indictment, said it vindicates the government's "proactive and preventive" approaches to such threats.

“We are constantly engaged with partners throughout the law enforcement community in order to keep the overall security picture in focus and to stay ahead of any emerging threats," said Roy Sexton, Secret Service special agent in charge.

A person who knew Kodoriov at the Oak Mountain Lodge said he was “completely shocked” about the allegations.

“I’m happy that he’s caught,” Sukru Icimsoy, the lodge's manager, said. “When law enforcement comes for a person here, I’d rather them stay with law enforcement than with me.”

Kodoriov came to the United States in June 2009 and remained in the country on a student visa, according to the statement. His student visa was revoked April 1, 2010, for failure to enroll in school, according to the arrest affidavit.

If convicted, he faces maximum sentences of five years in prison on each count of threatening the president and 10 years in prison on each of the weapons counts.