A man has been charged after being shot by a homeowner after allegedly being found naked and hiding in a cupboard in the stranger's house.
Police said Angus Templeman was intoxicated when he broke into a house in Stake Hill, a suburb of Mandurah, about 70km south of Perth, in the early hours of Sunday.
It's alleged the homeowner found Templeman in the wardrobe of a bedroom where a six-year-old girl was sleeping.
READ MORE: How police allege the murders of Jesse Baird and Luke Davies unfolded
The homeowner said he was woken by his dogs barking. He armed himself and started searching the house.
He found the alleged intruder and shot at him, injuring the 27-year-old's leg.
Templeman allegedly fled the scene before being found a short time later by the canine squad, and arrested.
Today he faced court charged with one count each of aggravated home burglary and indecent dealing with a child under 13.
Templeman was granted bail but must stay 300 metres away from the place of his alleged offending, and must report to police twice a week.
He will return to court in a month.