By Cecilio Padilla

CERES (CBS13) — Authorities have arrested the alleged shoplifter suspected of shooting at a Home Depot loss prevention worker in Ceres over the weekend.

Ceres police said, early Sunday afternoon, loss prevention spotted two men who were suspected of previously stealing from the store. Again, loss prevention spotted the men loading up a tote bag with more merchandise.

READ MORE: Youth Football Players Rally For Opportunity To Use Elk Grove Schools' Facilities Again

The men were soon trying to run out of a fire exit. This time, a loss prevention agent was waiting outside. When the suspects ran out, the agent confronted them and told the pair to drop the items.

However, police say the suspect who wasn’t carrying the bad pulled out a handgun and shot at the loss prevention agent.

No one was hurt in the shooting, police say.

Both men were seen running to a waiting sedan. The group took off and were last headed towards Highway 99 – but, someone managed to take down the license plate.

READ MORE: Highway 50 Temporarily Reopened Monday, Full Reopening Expected Tuesday 

Detectives were able to track the car to a property in Turlock. With the help of several other local law enforcement agencies, the home was surrounded and a man – 45-year-old Turlock resident Edward Lopez – was spotted on the roof.

After some time, Lopez was arrested by a SWAT team. He had a loaded handgun in his waistband, police say.

More people slowly emerged out of the home over the next few hours at the commands of crisis negotiators over a loudspeaker. However, none of those people matched the description of the people wanted for the Home Depot incident.

More from CBS Sacramento:

Police say Lopez has been identified as the suspect who allegedly pulled out a gun and shot at the loss prevention agent. He has been booked into jail and is facing charges of attempted murder, robbery, ex-felon in possession of a firearm, and sever other outstanding warrants.

MORE NEWS: Vehicle Drives Into Building In Sacramento

Detectives are still trying to identify the other man who was with Lopez and the getaway driver. Anyone with information relevant to the investigation is urged to call Crime Stoppers at (209) 521-4636.