LUBBOCK, Texas (CBSDFW) – A Lubbock man who allegedly plotted a mass shooting pleaded guilty today to making false statements to a federally-licensed firearms dealer.

William Patrick Williams, 20, was charged via criminal complaint in August 2019 with making a false statements during the purchase of a firearm. He pleaded guilty today before U.S. Magistrate Judge D. Gordon Bryant, Jr., in Lubbock.

READ MORE: COVID-19 Delta Variant 'Accelerating' In North Texas And Across The Nation

“This defendant subverted important firearms laws to obtain a weapon with the intention of producing mass fatalities,” said U.S. Attorney Erin Nealy Cox. “Thanks to the efforts of the defendant’s family members and law enforcement, this tragedy has been averted. If you suspect a friend or loved one is planning violence against themselves or others, do not hesitate to seek help immediately by calling law enforcement.”

According to the criminal complaint, Williams told his grandmother he had recently purchased an AK-47 rifle and planned to “shoot up” a local hotel and then commit suicide by cop. Sensing he was both homicidal and suicidal, she convinced him to allow her to bring him to a local hospital instead.

Williams gave officers consent to search the room he had rented at the hotel, where officers found an AK-47 rifle, seventeen magazines loaded with ammunition, multiple knives, a black trench coat, black tactical pants, a black t-shirt that read “Let ‘Em Come,” and black tactical gloves with the fingers cut off. Williams told officers he had laid out his weapons on the bed so that law enforcement could take custody of them.

READ MORE: Frisco's Grand Park No Longer An 'Urban Legend' As City Can Finally Finish Exide Cleanup

ATF received the firearms transaction form that Williams had completed when purchasing the AK-47. On the form, Williams listed an address where he no longer lived.

According to court documents, agents discovered that Williams was actually living with a roommate at a different residence and had been residing there for a month or longer at the time he completed the Form 4473. Williams admitted to misrepresenting his current address on the firearms transaction form.

“The FBI and our partners at the ATF and Lubbock Police Department were able to respond quickly and stop Mr. Williams from harming anyone or himself,” said Matthew DeSarno, Special Agent in Charge of the Dallas Field Office. “We will continue working with our law enforcement partners to protect the communities we serve.”

Williams faces up to five years in federal prison for his crime. A sentencing date was not set yet.

MORE NEWS: Amber Alert Issued For Dallas Brothers 2 And 4 Years Old; With Father Who Is A Homicide Suspect