Rodolfo Montoya was furious, police said, and he shared his feelings with a co-worker in a palm-tree lined Marriott hotel not far from Long Beach Airport in Southern California. In fact, the 37-year-old cook divulged exactly what he planned to do: “Shoot up” everyone at the hotel, police say.

Concerned, the co-worker told hotel management about the exchange this week, and they reported it to the police. When authorities arrived at Montoya’s house on Tuesday, they say they discovered an assault rifle, multiple other firearms and hundreds of rounds of ammunition.

“At the end of the day, we prevented a tragedy,” Long Beach Police Chief Robert Luna said at a news conference on Wednesday. “Because this was reported, I firmly believe many lives were saved.”

Montoya was arrested on suspicion of manufacturing and distributing assault weapons, possession of an assault weapon and making criminal threats, the Los Angeles Times reported.

Montoya’s arrest comes as police nationwide have charged dozens with plotting or threatening mass shootings in the weeks since gunmen killed 31 people in El Paso and Dayton, Ohio. Since last week, Montoya and at least three others around the country have been arrested over threats to commit mass shootings.

On Friday, police in Daytona Beach, Fla., arrested Tristan Scott Wix, 25, after he allegedly texted an ex-girlfriend about his plans to commit a mass shooting. “I’d wanna break a world record for longest confirmed kill ever,” one of the text messages read, according to police. Authorities later recovered a hunting rifle and 400 rounds of ammunition from his apartment, Spectrum News 13 reported. He was charged with threatening to commit a mass shooting.

That same day in Daytona Beach, police also handcuffed a 15-year-old high school student, Adam Guzzetti, who allegedly wrote on the gaming platform Discord that he “vow(ed) to bring my fathers m15 to school and kill 7 people at a minimum.” The student later claimed the comment was a joke. The FBI notified the local police department after someone sent them an anonymous tip, BuzzFeed News reported. He was charged with threatening to discharge a destructive device.

On Wednesday, police in Clarksville, Tenn., arrested 20-year-old Jacob Cooper after he allegedly left a comment on iFunny, a meme-sharing site, threatening to “shoot up” a facility run by Planned Parenthood in Washington. His post detailed his intention to go to the facility this week. He was charged with transmitting a threatening to injure another, according to the Justice Department.

Since the shootings in El Paso and Dayton earlier this month, at least 28 people have been arrested over threats of mass shootings, CNN reported. Local and federal agencies have faced increased pressure to identify and arrest potential mass shooters before they can attack, but experts say that law enforcement officials need help from community members to do their jobs.

“The community has a primary role. They’re the ones who know the person who might commit this act intimately,” Katherine Schweit, a former FBI executive who co-authored a 2014 study of 160 active shooter incidents, told CNN. “These are planned incidents, and planned incidents give us an opportunity to intercede.”

In Long Beach, Calif., police would not have known about Montoya’s threats had a co-worker not come forward, police said. He had no known criminal record and no evident restrictions on buying firearms.

While police have announced an official motive, they say Montoya was upset over a HR issue at work before divulging his plans to commit a mass shooting to his fellow employee.

Police found 38 high-capacity magazines at his apartment in Huntington Beach, in addition to the assault rifle, multiple other firearms and hundreds of rounds of ammunition. Police said they didn’t know whether he legally purchased all the weapons.

“Suspect Montoya had clear plans, intent and the means to carry out an act of violence that may have resulted in a mass casualty incident,” Luna said at the Wednesday news conference.

Police say they are still investigating Montoya and how serious a threat he posed to the hotel. It is not clear at this time whether he has an attorney.

“Thank God that employee decided to bring that information forward,” Luna added.

Montoya is being held at the Long Beach City Jail in lieu of $500,000 bail, the Times reported.