Crime scene tape surrounds the Mandalay Hotel (background) after a gunman killed at least 50 people and wounded more than 200 others when he opened fire on a country music concert in Las Vegas, Nevada on October 2, 2017. 
Police said the gunman, a 64-year-old local resident named as Stephen Paddock, had been killed after a SWAT team responded to reports of multiple gunfire from the 32nd floor of the Mandalay Bay, a hotel-casino next to the concert venue. / AFP PHOTO / Mark RALSTON        (Photo credit should read MARK RALSTON/AFP/Getty Images)
PHOTO: MARK RALSTON/AFP/Getty Images
Crime scene tape surrounds the Mandalay Hotel (background) after a gunman killed at least 50 people and wounded more than 200 others when he opened fire on a country music concert in Las Vegas, Nevada on October 2, 2017. Police said the gunman, a 64-year-old local resident named as Stephen Paddock, had been killed after a SWAT team responded to reports of multiple gunfire from the 32nd floor of the Mandalay Bay, a hotel-casino next to the concert venue. / AFP PHOTO / Mark RALSTON (Photo credit should read MARK RALSTON/AFP/Getty Images)
Now playing
01:25
These are the deadliest mass shootings in modern US history
FBI Director Christopher Wray testifies before the Senate Judiciary Committee on the January 6th insurrection, in the Hart Senate Office Building on Capitol Hill in Washington, DC on March 2, 2021. (Photo by MANDEL NGAN / POOL / AFP) (Photo by MANDEL NGAN/POOL/AFP via Getty Images)
PHOTO: MANDEL NGAN/POOL/AFP via Getty Images
FBI Director Christopher Wray testifies before the Senate Judiciary Committee on the January 6th insurrection, in the Hart Senate Office Building on Capitol Hill in Washington, DC on March 2, 2021. (Photo by MANDEL NGAN / POOL / AFP) (Photo by MANDEL NGAN/POOL/AFP via Getty Images)
Now playing
02:55
Watch FBI director debunk conspiracy theories pushed by Trump supporters
WASHINGTON, DC - FEBRUARY 10: Neera Tanden, nominee for Director of the Office of Management and Budget (OMB), testifies at her confirmation hearing before the Senate Budget Committee on February 10, 2021 at the U.S. Capitol in Washington, DC. Tanden helped found the Center for American Progress, a policy research and advocacy organization and has held senior advisory positions in Democratic politics since the Clinton administration. (Photo by Anna Moneymaker-Pool/Getty Images)
PHOTO: Anna Moneymaker-Pool/Getty Images
WASHINGTON, DC - FEBRUARY 10: Neera Tanden, nominee for Director of the Office of Management and Budget (OMB), testifies at her confirmation hearing before the Senate Budget Committee on February 10, 2021 at the U.S. Capitol in Washington, DC. Tanden helped found the Center for American Progress, a policy research and advocacy organization and has held senior advisory positions in Democratic politics since the Clinton administration. (Photo by Anna Moneymaker-Pool/Getty Images)
Now playing
01:33
Neera Tanden releases statement on pulling her nomination
PHOTO: KCAL/KCBS
Now playing
01:41
Multiple people killed in crash after SUV and semitruck collide
nigeria kidnapped schoolgirls released Busari pkg intl ldn vpx_00000423.png
nigeria kidnapped schoolgirls released Busari pkg intl ldn vpx_00000423.png
Now playing
02:09
Tears of joy and relief as 279 Nigerian schoolgirls return home
New satellite images taken by Maxar show that North Korea sometime in the past year built a structure that may be intended to obscure entrances to an underground facility where nuclear weapons or nuclear weapons components are stored.
PHOTO: Courtesy Maxar
New satellite images taken by Maxar show that North Korea sometime in the past year built a structure that may be intended to obscure entrances to an underground facility where nuclear weapons or nuclear weapons components are stored.
Now playing
01:47
See images US intelligence claims is a secret weapons site
NEW YORK, NY - JULY 23: New York Gov. Andrew Cuomo speaks during the daily media briefing at the Office of the Governor of the State of New York on July 23, 2020 in New York City. The Governor said the state liquor authority has suspended 27 bar and restaurant alcohol licenses for violations of social distancing rules as public officials try to keep the coronavirus outbreak under control. (Photo by Jeenah Moon/Getty Images)
PHOTO: Jeenah Moon/Getty Images
NEW YORK, NY - JULY 23: New York Gov. Andrew Cuomo speaks during the daily media briefing at the Office of the Governor of the State of New York on July 23, 2020 in New York City. The Governor said the state liquor authority has suspended 27 bar and restaurant alcohol licenses for violations of social distancing rules as public officials try to keep the coronavirus outbreak under control. (Photo by Jeenah Moon/Getty Images)
Now playing
02:29
NYT: Third woman comes forward against Gov. Andrew Cuomo
PHOTO: Courtesy Penguin Random House
Now playing
01:00
These 6 Dr. Seuss books won't be published anymore
John King Magic Wall 0301
PHOTO: CNN
John King Magic Wall 0301
Now playing
03:00
US coronavirus numbers coming down, but not enough
FILE - In this Jan. 29, 2011 file photo, Saudi journalist Jamal Khashoggi speaks on his cellphone at the World Economic Forum in Davos, Switzerland. Saud Al-Mojeb, Saudi Arabia's top prosecutor, is recommending the death penalty for five suspects charged with ordering and carrying out the killing of Saudi writer Jamal Khashoggi. Al-Mojeb told a press conference in Riyadh Thursday, Nov. 15, 2018,  that Khashoggi's killers had been planning the operation since September 29, three days before he was killed inside the kingdom's consulate in Istanbul. (AP Photo/Virginia Mayo, File)
PHOTO: Virginia Mayo/AP
FILE - In this Jan. 29, 2011 file photo, Saudi journalist Jamal Khashoggi speaks on his cellphone at the World Economic Forum in Davos, Switzerland. Saud Al-Mojeb, Saudi Arabia's top prosecutor, is recommending the death penalty for five suspects charged with ordering and carrying out the killing of Saudi writer Jamal Khashoggi. Al-Mojeb told a press conference in Riyadh Thursday, Nov. 15, 2018, that Khashoggi's killers had been planning the operation since September 29, three days before he was killed inside the kingdom's consulate in Istanbul. (AP Photo/Virginia Mayo, File)
Now playing
02:52
3 names mysteriously removed from Khashoggi Intel report
Protesters take cover behind homemade shields as tear gas is fired during a demonstration against the military coup in Yangon on March 1, 2021. (Photo by STR / AFP) (Photo by STR/AFP via Getty Images)
PHOTO: STR/AFP/AFP via Getty Images
Protesters take cover behind homemade shields as tear gas is fired during a demonstration against the military coup in Yangon on March 1, 2021. (Photo by STR / AFP) (Photo by STR/AFP via Getty Images)
Now playing
02:16
Footage shows tear gas, flash bangs used on protesters in Myanmar
New York Gov. Andrew Cuomo speaks during a news conference at a COVID-19 vaccination site in the Brooklyn borough of New York, Monday, Feb. 22, 2021. (AP Photo/Seth Wenig, Pool)
PHOTO: Seth Wenig/Pool/AP
New York Gov. Andrew Cuomo speaks during a news conference at a COVID-19 vaccination site in the Brooklyn borough of New York, Monday, Feb. 22, 2021. (AP Photo/Seth Wenig, Pool)
Now playing
01:12
Gov. Andrew Cuomo responds to allegations of sexual harassment
 Psaki biden White House Khashoggi Saudi Arabia sotu bash vpx _00011629.png
PHOTO: CNN
Psaki biden White House Khashoggi Saudi Arabia sotu bash vpx _00011629.png
Now playing
03:42
Bash to Psaki: Why hasn't Saudi Arabia been held accountable for murder of Khashoggi?
NEW YORK, NY - JULY 23: New York Gov. Andrew Cuomo speaks during the daily media briefing at the Office of the Governor of the State of New York on July 23, 2020 in New York City. The Governor said the state liquor authority has suspended 27 bar and restaurant alcohol licenses for violations of social distancing rules as public officials try to keep the coronavirus outbreak under control. (Photo by Jeenah Moon/Getty Images)
PHOTO: Jeenah Moon/Getty Images
NEW YORK, NY - JULY 23: New York Gov. Andrew Cuomo speaks during the daily media briefing at the Office of the Governor of the State of New York on July 23, 2020 in New York City. The Governor said the state liquor authority has suspended 27 bar and restaurant alcohol licenses for violations of social distancing rules as public officials try to keep the coronavirus outbreak under control. (Photo by Jeenah Moon/Getty Images)
Now playing
04:04
NYT: Second former aide accuses Gov. Andrew Cuomo of sexual harassment
PHOTO: CNN Weather
Now playing
02:23
Over 25 million people under threat for severe storms and flash flooding
House Speaker Nancy Pelosi
PHOTO: House TV
House Speaker Nancy Pelosi
Now playing
02:52
House passes Biden's $1.9 trillion Covid-19 relief package
Jeremy Lin
PHOTO: Getty Images
Jeremy Lin
Now playing
03:40
Ex-NBA star Jeremy Lin says he's been called 'coronavirus' on the court
(CNN) —  

Less than a month before two deadly shootings took the lives of 29 people in one weekend, another mass shooting was stopped.

A Lubbock, Texas man, identified as William Patrick Williams, 19, was arrested by special agents of the FBI and ATF, the US Attorney’s Office of the Northern District of Texas announced Friday.

Williams was allegedly contemplating a mass shooting and bought ammunition. He rented a hotel room where he was plotting to kill people before his grandmother persuaded him to visit a hospital after learning of his plan, the release said.

According to the release, Williams told his grandmother on July 13 he had recently purchased an AK-47 rifle, was planning to “shoot up” a hotel and “then commit suicide by cop.”

The grandmother was able get him into treatment prior to his arrest.

Authorities applauded the courageous actions of Williams’ grandmother, saying her interference likely saved the lives of many.

“This was a tragedy averted,” said US Attorney Nealy Cox. “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.”

Williams was arrested after a hospitalization and gave investigators permission to search his hotel room, the release said.

Investigators uncovered an AK-47 rifle, 17 magazines loaded with ammunition and multiple knives in Williams’ hotel room, according to the release.

Williams told officers he had laid out his weapons on a bed so that law enforcement could take custody of them.

Other items recovered from the room included a black trench coat, black tactical pants, a black T-shirt that read “Let ‘Em Come,” the press release said.

On July 21, the ATF received a firearms transaction form filled out on July 11 where Williams lied about his residence.

He has been charged with making false statements to a firearms dealer because of his claim that he lived at an address where he had been evicted. The offense carries up to five years in federal prison.

“The FBI worked closely with our partners at the ATF and Lubbock Police Department to prevent the defendant from potentially committing a violent act,” said Matthew DeSarno, special agent in charge of the FBI’s Dallas field office.

“This case is a perfect example of law enforcement agencies coming together to find a solution that protected the public from harm.”