The Catechism in Questions & Answers

337. What does the commandment say about killing in war?

Killing in war is a violation of the Fifth Commandment. For the individual, the commandment implies a responsibility to avoid killing wherever possible. In individual cases it may be that one’s actions barely incur any guilt before God in such situations.

Guilt before God: see Question 230.