Positive commandment · Mitzvat Aseh #190 of 613
To wage a voluntary war according to the laws prescribed by the Torah
לעשות במלחמת הרשות כמשפט הכתוב בתורה
The verse · Devarim 20:10
כִּי־תִקְרַב אֶל־עִיר לְהִלָּחֵם עָלֶיהָ וְקָרָאתָ אֵלֶיהָ לְשָׁלוֹם
“When thou comest near to a city to fight against it, then proclaim peace to it.”
The Rambam’s words
To wage a voluntary war according to the laws prescribed by the Torah, as [Deuteronomy 20:10] states: "When you approach the city...."
לעשות במלחמת הרשות כמשפט הכתוב בתורה, שנאמר: "כי תקרב אל עיר" (דברים כ,י).
Why · Sefer HaChinuch #527
To send peace to the cities that we besiege
“It is from the roots of the commandment [that it is] because the trait of mercy is a good trait and it is fitting for us — the holy seed — to practice in all of our matters.”
Who & when
“And this commandment is practiced — at the time that Israel is on their Land — by males, as they are fit for war.”
Where in the Mishneh Torah
Hilchot Kings and Wars הלכות מלכים ומלחמות