Catechism of the Catholic Church:
2307. All citizens and all governments are obliged to work for the avoidance of war. Despite this admonition of the Church, it sometimes becomes necessary to use force to obtain the end of justice.
This is the right, and the duty, of those who have responsibilities for
others, such as civil leaders and police forces. While individuals may
renounce all violence those who must preserve justice may not do so,
though it should be the last resort, “once all peace efforts have
failed.”