There are several places in Scripture that advocate defense with deadly force.
Just this past week, Jews celebrated the holiday of Purim, commemorating the events of the Book of Esther. There, an evil advisor named Haman plotted to slay all the Jews in the known world, and take their possessions for spoil (Esther 3:9,10,13). The rescue came when, after the Jews’ repentance and prayer (4:3), G.d induced the king to first kill Haman (7:10) and then (8:11) “to grant the Jews who are in every city [the right] to assemble and to protect their lives, to destroy… [all] who oppress them.” Thus it came about:
And the Jews smote all their enemies with the stroke of the sword and with slaying and destruction, and they did to their enemies as they wished.
~ Esther 9:5
Over 75,000 people who would have killed the Jews were instead killed themselves throughout the empire (9:16), and a new holiday was born to celebrate the survival of the Jewish people (9:31).