A man was shot Thursday morning after allegedly trespassing in a Phoenix backyard.

Authorities were called to the home near 43rd and Peoria avenues early Thursday after receiving reports of a shooting.

According to officials, a woman was startled awake after hearing noises in the backyard. She told her husband, who then went outside to search for anything suspicious.

The man was seen in the couple’s shed, officials said. The man decided to hold the shed’s door shut and instructed his wife to call 911 and grab his gun.

During the struggle to keep the suspect locked inside the shed, the man’s gun accidentally discharged and he shot the alleged intruder in the leg.

The suspect was allegedly impaired and has warrants out for his arrest, officials confirmed.

No additional information was immediately available.