SANTA ANA (CBSLA) — A possibly armed man who authorities say tried to rob and carjack a pizza delivery driver was arrested Wednesday morning after he broke into a Santa Ana home and barricaded himself inside, prompting a nearly 12-hours SWAT standoff in which officers fired flash-bang grenades.

July 10, 2019. (CBS2)

The suspect, identified as 26-year-old Ralph Marin, was taken into custody just after 7 a.m., Santa Ana police report.

READ MORE: Dog Flu Spreading Quickly Across LA County

The situation began at around 7:30 p.m. Tuesday, when officers responded to a report that a man tried to rob and carjack a Pizza Hut delivery driver outside a Chevron station at Bristol Street and West Alton Avenue, police said. When the driver fought back, the suspect pistol-whipped him and ran away.

Officers began a foot pursuit of the suspect, but lost sight of him, Santa Ana police Cpl. Anthony Bertagna said. However, a short time later, a homeowner in the 3200 block of South Thornton Street called 911 to report that an armed man had entered his home with his family still inside.

READ MORE: Housing Crisis: Newsom Signs Measures To Allow For More Duplexes, Apartments Near Transit

According to Bertagna, the family safely escaped by going out a window and onto the roof of their home, where they were rescued by police. None of them were hurt.

Police blocked off several surrounding streets during the nearly 12-hour standoff. Officers fired flash-bang grenades to try and coax the suspect out. He eventually surrendered.

MORE NEWS: LA County Announces Re-Homing Program To Help Keep Pets Out Of Shelters

The delivery driver’s condition and injuries were not immediately confirmed. It’s unclear exactly what charges Marin will face.