A Lubbock man was arrested on Thursday after he threatened a mass shooting earlier in July.

19-year-old William Patrick Williams was charged with knowingly making a false statement while attempting to purchase a firearm.

KAMC News reports that back on July 13th, Lubbock Police Officers were informed that Williams was admitted to Covenant Medical Center for a psychiatric assessment after making the threats. He was admitted after his grandmother convinced him to let her pick him up and take him there.

Williams had allegedly purchased a rifle and admitted he wanted to "shoot up" the hotel he was currently staying at, and was going to commit suicide after the police arrived.

When police arrived at the hotel Williams was staying at, they found an AK-47 rifle, 17 magazines loaded with ammunition and multiple knives.

Matthew DeSarno, Special Agent in Charge of the Dallas Field Office, said:

The FBI worked closely with our partners at the ATF and Lubbock Police Department to prevent the defendant from potentially committing a violent act. [...] This case is a perfect example of law enforcement agencies coming together to find a solution that protected the public from harm.

Williams faces up to 5 years in prison, if convicted.