Don’t try this at home.

An unarmed San Francisco homeowner emerged victorious after bravely taking on an armed intruder who entered his garage.

The man's home surveillance video showed the two men wrestling on the floor in a dramatic struggle for the trespasser’s pistol.

The homeowner stayed on top of the attacker and managed to pry the gun away.

At the end of the video, which was released by San Francisco police, the homeowner can be seen pointing the gun at the intruder as he ran off.

The suspect is still on the run. Police later said that the intruder's firearm "had no bullets, or no magazine was attached.”

Watch the life-or-death struggle in the video above.