LUBBOCK, Texas (CBSDFW.COM) – A Lubbock man who plotted a mass shooting has been sentenced to two years in federal prison for 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 statement during the purchase of a firearm.

READ MORE: Appeals Court Ruling Keeps Abortion Ban In Place In Texas

He pleaded guilty earlier this month and was sentenced by a judgeThursday, Nov. 5 in Lubbock.

William Patrick Williams (credit: Lubbock County Jail)

“We are grateful to the many people – both within the defendant’s family and inside law enforcement – who came together to avert tragedy,” said U.S. Attorney Erin Nealy Cox. “We are hopeful Mr. Williams will get the treatment he needs while incarcerated.”

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.

READ MORE: Amtrak Train From Fort Worth Crashes In Oklahoma, Four Hurt

Williams gave officers consent to search the room he had rented at the hotel, where they 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. Mr. Williams told officers he had laid out his weapons on the bed so that law enforcement could take custody of them.

According to his plea papers, Williams admits he lied on the form he used to purchase the AK-47 from a local sporting goods store, listing an address where he no longer resided.

Court documents indicate that the residents of the address Williams listed on the form told agents they had changed the locks after he moved out; at the time of the purchase, he was actually living with a different roommate at a different address.

The defendant admitted to misrepresenting his current address on the firearms transaction form.

As a convicted felon, Williams will now be legally barred from possessing a weapon after he is released from prison.

The Court recommended that Williams serve his 24-month incarceration at the Federal Medical Center in Fort Worth, Texas, and further recommended that prior to his release from prison, Williams be evaluated for the possibility of civil commitment for mentally ill persons who are due to be released but whose release would create a substantial risk of serious bodily injury or serious property damage to others.

MORE NEWS: Critical Race Theory Law Could Be Behind Latest Southlake Racism Controversy