EL PASO, TEXAS (KFOX14/CBS4) — A 26-year-old man accused of a crime spree in Las Cruces was arrested in El Paso after breaking into a home last week, spending roughly four hours inside before the homeowner returned and held him at gunpoint, according to court documents.

According to an arrest affidavit obtained by KFOX14/CBS4 on Thursday, Jesus Angel Cortez was arrested on Aug. 16 on a burglary charge after officers were called to a burglary in progress at about 9:34 p.m at the home on the 600 block of Upson in Central El Paso and found that Cortez was locked in a bathroom after the homeowners arrived.

The affidavit states that when police arrived, they found the homeowner holding Cortez at gunpoint inside an upstairs restroom, where officers then arrested Cortez at the scene.

Investigators said the homeowner had been out of town for a soccer tournament. His wife and two children had also been away from the residence and returned at approximately 9:20 p.m.

One of the children allegedly heard an unknown man upstairs, including the sound of footsteps and someone clearing his throat. The homeowner was contacted and hurried back to the residence, according to the affidavit.

The homeowner told police that after arriving, he armed himself and searched the house, where he found Cortez inside an upstairs restroom, court documents state.

According to the affidavit, Cortez closed and locked the restroom door as the homeowner approached. The homeowner told investigators he then kicked the door and made a hole that allowed him to see Cortez sitting near the toilet with a towel wrapped around his arm and allegedly attempting to hide behind a vanity.

The homeowner eventually broke open the door and held Cortez at gunpoint until police arrived, the affidavit states.

RELATED: Man accused in Las Cruces crime spree arrested after El Paso break-in

According to court documents, surveillance video from cameras installed at the residence allegedly shows the moment Cortez entered the home.

According to investigators, the video showed Cortez entering the backyard at approximately 5:32 p.m. and breaking a rear basement window before entering the home at about 5:33 p.m.

Police said the footage did not show Cortez leaving the residence before officers were called at 9:34 p.m., meaning he allegedly remained inside for about four hours.

The affidavit states that Cortez could be seen wearing a black long-sleeve shirt with the word “Disneyland” on it and black sweatpants. Officers later reported finding a similar shirt and a gray glove near the broken basement window.

Officers searching Cortez at the scene also found six bracelets, a gray-and-black USB device, and a photograph of a woman in his pockets.

The homeowner’s daughter identified the bracelets and other property as belonging to her, according to the affidavit. Police also reported that her bedroom appeared to have been rummaged through and drawers had been left open.

Cortez allegedly told officers that his grandfather owned the residence and had given him permission to enter it. Investigators contacted the grandfather, who told them he did not own property in the Upson Drive area, according to the affidavit.

Police also reported finding an orange container labeled as containing THC gummies and a small plastic item containing burnt residue. The affidavit states that subsequent testing of the orange gummy substance was negative for both THC and CBD. Its gross weight was listed as 15.12 grams.

Cortez was transported for booking and later booked into the El Paso County Detention Facility, according to the affidavit.

Las Cruces Crime Spree

Cortez’s arrest in El Paso comes after he was already facing charges in Las Cruces after he allegedly went on a crime spree there, randomly shooting at a car and then trying to break into the home of his children’s mother and steal a child.

According to the Las Cruces Police Department, Cortez allegedly shot at a car, injuring a 34-year-old man and his 11-year-old son at the intersection of South Solano Drive and Missouri Avenue in Las Cruces. The man suffered a gunshot wound, while his son suffered shrapnel injuries to his face and arms.

LCPD investigators said they believe the drive-by shooting was unprovoked, adding that the victims said they don’t know Cortez or had any interaction with him before the shooting.

Cortez was reportedly driving a charcoal Dodge Durango when the shooting happened.

Then, that same day, authorities believe Cortez tried to take the kid from his children’s mother’s home, leaving a broken window and a gun at the scene, which police believe he dropped before fleeing.

Cortez faces multiple charges in Las Cruces, including shooting at or from a motor vehicle causing injury, two counts of aggravated battery with a deadly weapon, two counts of child abuse, and aggravated burglary.

RECOMMENDED: Las Cruces man arrested in El Paso after drive-by shooting, child abduction attempt

Sign up to receive the top interesting stories from in and around our community once daily in your inbox.