Sefer HaMitzvot, Positive Commandments 188
ספר המצוות, מצוות עשה קפ״ח
Sefer HaMitzvot, Positive Commandments 188
Rambam lists the commandment to annihilate Amalek. This is one of his paradigms of milchemet mitzvah and shows that some war obligations remain binding as mitzvot in all generations where the circumstances obtain.
וכבר קדם לנו שלש מצות נצטוו בני ישראל בכניסתן לארץ, למנות להם מלך ולבנות בית הבחירה ולמחות זרע עמלק. ומלחמה זו היא מלחמת מצוה.