Four men were behind bars Wednesday in connection with the killing of a security guard who was gunned down at an illegal gambling establishment in the Hollywood Hills area during an attempted robbery, authorities said on Wednesday.

All four were booked on suspicion of murder in connection with the death of Anthony Rivas, 32, who was shot about 3:40 a.m. May 31 in the 3300 block of Cahuenga Boulevard, Los Angeles police said.

Two armed men wearing ski masks entered the rear of the building that morning, police said, intending to commit a robbery. The security guard began observing the two and removed a pistol from his waistband.

One suspect pointed a rifle at the security guard and fired multiple times, striking and fatally injuring the guard, police said, with the suspects fleeing empty-handed after searching the establishment for money.

Detectives said those arrested were the getaway driver, two gunmen and another suspect who was sent inside to provide distraction so the door would be left open for the gunmen to gain entry, KCAL reported.

After obtaining a search warrant, detectives found weapons, the getaway car and both guns used in the crime in the suspects’ homes in Glendora, Oxnard and Los Angeles, including in the San Fernando Valley, according to the TV station.

The four arrested were: Steven Hans Dunkel, 23, of Glendora; Matthew Scott Riley, 29, of Panorama; Michael John Blankenship, 52, of Oxnard; and Rudy Javier Madrid, 26, of North Hollywood. All of them were being held in lieu of $2 million bail, except for Madrid, whose bail was set at $200,000.