The Rambam · Sefer Shoftim
הלכות מלכים ומלחמות א׳Kings and Wars 1
Chapter 1 of 12 in Kings and Wars — 12 halachot
Halacha 1א׳
שָׁלֹשׁ מִצְוֹת נִצְטַוּוּ יִשְׂרָאֵל בִּשְׁעַת כְּנִיסָתָן לָאָרֶץ. לְמַנּוֹת לָהֶם מֶלֶךְ שֶׁנֶּאֱמַר (דברים יז טו) "שׂוֹם תָּשִׂים עָלֶיךָ מֶלֶךְ". וּלְהַכְרִית זַרְעוֹ שֶׁל עֲמָלֵק שֶׁנֶּאֱמַר (דברים כה יט) "תִּמְחֶה אֶת זֵכֶר עֲמָלֵק". וְלִבְנוֹת בֵּית הַבְּחִירָה שֶׁנֶּאֱמַר (דברים יב ה) "לְשִׁכְנוֹ תִדְרְשׁוּ וּבָאתָ שָּׁמָּה":
Three precepts Israel, were enjoined to fulfill after having entered the land of Canaan, viz :— 1. To appoint a king; for it is said: Thou shalt set in any wise a king over thee, (Deut. 17. 15). 2. To exterminate the offspring of Amalek, for it is said: Thou shalt blot out the remembrance of Amalek, etc., (Deut. 25. 19). 3. To erect the temple, for it is said : Unto His habitation shall you seek, and thither thou shalt come, (Deut. 12. 5).
Halacha 2ב׳
מִנּוּי מֶלֶךְ קוֹדֵם לְמִלְחֶמֶת עֲמָלֵק. שֶׁנֶּאֱמַר (שמואל א טו א) "אֹתִי שָׁלַח ה' לִמְשָׁחֳךָ לְמֶלֶךְ" (שמואל א טו ג) "עַתָּה לֵךְ וְהִכִּיתָה אֶת עֲמָלֵק". וְהַכְרָתַת זֶרַע עֲמָלֵק קוֹדֶמֶת לְבִנְיַן הַבַּיִת. שֶׁנֶּאֱמַר (שמואל ב ז א) "וַיְהִי כִּי יָשַׁב הַמֶּלֶךְ בְּבֵיתוֹ וַה' הֵנִיחַ לוֹ מִסָּבִיב מִכָּל אֹיְבָיו" (שמואל ב ז ב) "וַיֹּאמֶר הַמֶּלֶךְ אֶל נָתָן הַנָּבִיא אָנֹכִי יוֹשֵׁב בְּבֵית אֲרָזִים" וְגוֹ'. מֵאַחַר שֶׁהֲקָמַת מֶלֶךְ מִצְוָה לָמָּה לֹא רָצָה הַקָּדוֹשׁ בָּרוּךְ הוּא כְּשֶׁשָּׁאֲלוּ מֶלֶךְ מִשְּׁמוּאֵל. לְפִי שֶׁשָּׁאֲלוּ בְּתַרְעֹמֶת. וְלֹא שָׁאֲלוּ לְקַיֵּם הַמִּצְוָה אֶלָּא מִפְּנֵי שֶׁקָּצוּ בִּשְׁמוּאֵל הַנָּבִיא. שֶׁנֶּאֱמַר (שמואל א ח ז) "כִּי לֹא אֹתְךָ מָאָסוּ כִּי אֹתִי מָאֲסוּ" וְגוֹ':
The election of a king preceded the war with Amalek; for it is Said: The Lord sent me to anoint thee to be king, (I Sam. 15. 1). Go and smite Amalek, etc., (I Sam. 15. 3). The destruction of the offspring of Amalek preceded the erection of the temple; for it is said: And it came to pass, when the king sat in his house, and the Lord had given him rest round about from all his enemies, that the king said unto Nathan the prophet, I dwell in a house of Cedar, etc., (II Sam. 7. 1). Such being the case, the appointment of a king being a divine institution, why was the Lord displeased when they desired a king? because their desire was only a mere subterfuge. They did not wish for a king with the intention of accomplishing the Lord’s command; but because they disliked the just government of Samuel, for it is said: For they have not rejected thee, but they have rejected me, (I Sam. 8. 7).
Halacha 3ג׳
אֵין מַעֲמִידִין מֶלֶךְ בַּתְּחִלָּה אֶלָּא עַל פִּי בֵּית דִּין שֶׁל שִׁבְעִים זְקֵנִים וְעַל פִּי נָבִיא. כִּיהוֹשֻׁעַ שֶׁמִּנָּהוּ משֶׁה רַבֵּנוּ וּבֵית דִּינוֹ. וּכְשָׁאוּל וְדָוִד שֶׁמִּנָּם שְׁמוּאֵל הָרָמָתִי וּבֵית דִּינוֹ:
No king can be elected except by a tribunal of seventy elders, in conjunction with a prophet; as Joshua, whom Moses and his conclave had appointed; and Saul and David whom Samuel the Ramathi and his conclave had installed.
Mishneh Torah, Torat Emet 363 edition, via Sefaria — public domain
English: Yad-Hachazakah, ed. Elias Soloweyczik, London 1863 — public domain
English: rendered from the Hebrew for this app — our own, not a borrowed translation