Fifth Commandment and self-defense

What is the biblical stance on self-defense that ends up in someone being killed/murdered in relation to the Fifth Commandment? Does God allow us to protect our family to that point, or are we charged to love our enemy and pray for those who persecute us regardless of what harm they may be intending to inflict? An example would be a home invasion or something of that sort.

The Hebrew word in the Fifth Commandment (Exodus 20:13 and Deuteronomy 5:17) prohibits murder—the illegal and inappropriate taking of human life—and does not forbid all taking of life. So, for example, governments can rightly implement capital punishment (Romans 13:4) if they so choose.

What about individuals who want to protect themselves and their families, you wonder? Some Christians look to Matthew 5:39 and Romans 12:17 as absolute directives not to resist physical threats. In their context though the verses advocate love toward others instead of seeking revenge.

Others look to sections of Scripture like Proverbs 24:11-12 and Luke 22:35-38 as the basis for defending oneself and one’s family from physical threats. John 18:10-11 describes Peter’s wrongful use of a weapon as he tried to interfere with the Lord’s humble submission to his Father’s will.

The positive emphasis of the Fifth Commandment “to help and befriend [our neighbor] in every bodily need” can find application in defending oneself and one’s family with a weapon.