Milkhemet Mitzvah

Milḥemet Mitzvah or in Biblical Hebrew Milḥemeth Miṣwah (Hebrew: מלחמת מצווה, "War by commandment") is the term for a war during the times of the Tanakh when a king (of the Kingdom of Israel) would go to war in order to fulfill something based on, and required by, the Torah without needing approval from a Sanhedrin, such as war against Amalek. In contrast, a "milkhemet reshut" (מלחמת רשות, "authorized war") is a discretionary war, which according to Jewish law requires the permission of a Sanhedrin.
Unlike "milkhemet reshut" wars, which tended to be fought to expand territory or for economic reasons and had exemption clauses, "milhemet mitzvah" tended to be invoked in defensive wars, when vital interests were at risk.
Applicability in modern times.
The categories of "milhemet mitzvah" and "milhemet reshut" were applied by the later rabbis to describe wars that place in earlier times, led by or against the kings of the Kingdoms of Israel and Judah. The "milhemet reshut" has not been applied or used since then; because the Jewish people have neither a king nor universally recognized Sanhedrin, there is no religious authority to authorize a "milhemet reshut". Notwithstanding, there is more than one description of the terms "Milhemet Mitzvah" and "Milhemet Reshut". According to the Jerusalem Talmud (4th-5th centuries), "Milhemet Reshut" is described as an offensive war, rather than a defensive war which is "Milhemet Mitzvah".
The discussion over compulsory and permitted (or, perhaps, "optional") wars also applies to certain exemptions given to individuals within the ancient Israelite and Judean society: engaged men, those who have just completed to build their house and have not lived in it and those who have not yet plowed their field before the war. All of these exemptions are given only in the case of "Milhemet Reshut." Talmud Scholars of both the Jerusalem and Babylonian Talmuds discussed the nature of the wars commenced by the Israelites during the biblical era (Tanakh) generally tend to describe the conquest of the Land of Israel in the Book of Joshua as Mitzvah Wars, while the wars fought by King David were meant to expand his kingdom, hence regarded as discretionary wars. Modern scholars also suggested that Mitzvah Wars originally signified a religious act.
Questions about the halakhic justification for war again arise in modern times in connection to military operations of, and service in, the Israel Defense Forces. To the extent that such operations are perceived to be self-defense, they are viewed as examples of milhemet mitzvah. Hence, the dispute over the terms with accordance to modern times coincides with the question what is Israel's role in the "Arab-Israeli Conflict". Many Israelis perceive the continuous sparks of violence as attempts to undermine the Jewish State, most Israelis may regard the modern wars as "Milhemet Mitzvah" defensive, and therefore, obligatory. On the other hand, large portions of the Israeli society are secular and do not think about the current conflict in these religious categories or use these historical terms.