A San Jose homeowner who was awakened in the middle of the night Friday by loud banging fired a shotgun through his glass door at what he believed were two armed intruders in his backyard, seriously injuring a 24-year-old man.

The homeowner, who was not identified, then ran out of his house in the 1700 block of Patio Drive without a shirt on, prompting an alarmed neighbor to call police at 4:18 a.m., San Jose police Sgt. Ronnie Lopez said.

When police arrived, the man who had fired the shotgun told them he had seen one of the intruders with what looked like a silver handgun.

Officers searched the gated yard and found the shattered French doors, the shooting victim and a cell phone, but no handgun. No traces of a second intruder were found.

The presumed intruder, who was not identified, was in serious condition Friday afternoon with a gunshot wound to his stomach area. A preliminary investigation also revealed he appeared to be under the influence of alcohol, Lopez said.

The homeowner was questioned by detectives and released Friday afternoon, pending further investigation. Police and prosecutors will weigh the “totality of the circumstances” in deciding whether he will face criminal charges, Lopez said.

Under California law, homeowners or renters who react violently to a perceived intruder are essentially given the benefit of the doubt.

The law presumes they acted out of a reasonable fear of imminent death or great bodily injury. They cannot be charged with a crime unless prosecutors can prove otherwise.

One factor that is likely to weigh heavily in whether the homeowner will have to face charges is that it was the second time officers had been called to the block Friday with a report of a disturbance — possibly by the same intruder.

“We believe they are one and the same, but we have not yet completely confirmed that,” Lopez said.

In the other incident, officers responded about 3 a.m. to a report from a homeowner that an inebriated man had tried to fit a key into the front door to gain entry. The homeowner yelled at the man, “Wrong house,” and the man left.

There is no evidence that the homeowner who shot the man knew about the first incident.

While San Jose is enjoying a decrease in serious crimes overall, it’s been a rough couple of days in the city.

On Wednesday night, a 20-year-old man was stabbed multiple times by two attackers at McLaughlin and Fair avenues in front of Bridges Academy, formerly Fair Middle School. The attackers fled and are still at large.

Tuesday night, San Jose police arrested two men after a violent robbery at a Locust Street home where officers said two residents have been growing marijuana; police have not said whether it was an illegal grow house. And shortly after that incident, police shot in the leg a man they thought might be one of the burglary suspects. The man, Anthony Silva, 30, turned out not to be connected to the burglary, police said Thursday, but he did have a no-bail warrant for his arrest stemming from drug possession charges.