A 29-year-old man was shot in the head by a man he was trying to rob during a home invasion in Wissinoming on Friday, according to police.

The would-be robber, whom police did not identify, forced his way into a home on the 6100 block of Hegerman Street around 12:10 a.m. Friday, pointing a gun at a 21-year-old man who was leaving the house and ordering him back inside, police said.

Inside the house, police said, the 29-year-old demanded money and jewelry from the 21-year-old and another man, also 29, holding them both at gunpoint. Police did not identify either of those men, but said one of them lived at the house.

All three men soon began struggling over the gun, police said, and during the fight the the 21-year-old broke away and got another handgun. The would-be robber regained control of his gun and pointed it at the younger man, police said, leading the 21-year-old to fire his gun and hit the intruder in the head.

Authorities responded and took the shooting victim to Aria Health-Torresdale campus, where he was listed in critical condition, police said.

A 28-year-old woman and her two children were asleep during the melee, police said. Authorities did not identify them but said they were unharmed.

No one had been charged as of Friday afternoon. Police said the investigation was ongoing.