In theory yes... A couple of years ago a guy and his family were tied up by burglars (who had guns) and were being robbed, he managed to get away, fight for the gun.
Got the gun, shot one (who died), and then chased the others away, when the cops arrived he got locked up and the judge planned...