By the time police arrived at his home, a Phoenix resident had a suspected burglar detained at gunpoint, on the ground with his hands behind his back.

ABC 15 reports that Phoenix police responded to a reported residential burglary around 5:30 a.m. May 10, near 67th and Thomas avenues. Police say a woman was holed up in her bedroom out of fear a stranger was in her apartment. She reportedly called her boyfriend and shared her fears. He had recently left for work.

Court records show the woman’s boyfriend returned to the home in the nick of time to stop Francisco Antonio Armendariz, 38, leaving the apartment. Her boyfriend drew his handgun and commanded Armendariz to get on the ground. That’s where police found Armendariz when they arrived on the scene.

Armendariz is alleged to have entered the apartment through a kitchen window. Once taken to 4th Avenue Jail on charges of criminal trespassing, police say Armendariz punched a fellow inmate in the face while he was asleep. He now has an additional charge of aggravated assault.

According to court and Arizona Department of Corrections records, the would-be burglar served 18 years in prison for armed robbery. Armendariz was released in October 2017.