I also recommend Ven. Sujato’s essay, posted by @Khemarato.bhikkhu .
In line with this, you may wish to read AN4.237 which deals with four kinds of kamma, one of which is particularly applicable to the situation described in your OP.
Also, War and Kamma: Ven. Thanissaro and Ven. Bodhi’s essays
Santi