A grandmother in Lubbock, Texas, stopped a possible mass shooting by convincing her grandson to get medical help after he told her he planned to kill people with his rifle.

The U.S. Attorney’s Office of the Northern District of Texas said in a press release that William Patrick Williams, 19, told his grandmother in July that he had purchased an AK-47 and planned to “shoot up” a hotel, then commit suicide.

However, Williams’ grandmother pleaded with him to seek medical treatment at a nearby hospital and he agreed, according to authorities.

“Sensing he was both homicidal and suicidal, she convinced him to allow her to bring him to a local hospital instead,” the press release said.

Reports state that police found the AK-47 inside a hotel room Williams had rented, along with 17 loaded magazines, knives, and black clothing. A T-shirt found in the room had the words “Let ‘Em Come” printed on it.

U.S. Attorney Nealy Cox praised the grandmother’s actions and said she saved the lives of not only the public but also law enforcement officers.

“This was a tragedy averted,” he said. “I want to praise the defendant’s grandmother, who saved lives by interrupting this plot, as well as the Lubbock police officers and federal agents who investigated his unlawful acquisition of a deadly weapon.”

Reports said after Williams was arrested Thursday, authorities obtained the transaction form he completed when he purchased the rifle. The form stated that he had listed a relative’s address when in fact he was evicted from the home and living with a friend.

Authorities also found documents chronicling Williams’ depression disorder and anti-depressant medication inside the hotel room.

“The safety of our citizens is paramount,” Lubbock Interim Police Chief Jerry Brewer commented. “When events like this occur we greatly appreciate the cooperative relationships with our federal law enforcement partners that enhance our abilities to protect the community.”

The press release stated that Williams was charged by criminal complaint with making false statements to a federally-licensed firearms dealer. He could face up to five years in federal prison if convicted.