"And he said: For a hand is upon the throne of the LORD" (Exodus 17:16). From the time He sits upon the throne of the LORD, there shall be war for Him; at that hour, "the LORD has war with Amalek." From here we learn that the appointment of a king precedes the cutting off of the seed of Amalek; so says Rabbi Yehoshua. Rabbi Elazar of Modi'in says: The Holy One, blessed be He, swore by His throne that if all the nations of the world come to convert, they shall be accepted from them, but from Amalek they shall not be accepted. As it is said (2 Samuel 1:13): "And David said to the young man who told him, 'Where are you from?' And he said, 'I am the son of a stranger, an Amalekite.'" At that hour David recalled what had been said to Moses his teacher: that if any of all the nations of the world come to convert, Israel shall accept them, but Amalek they shall not accept. And David said to him: "Your blood be upon your head; your own mouth has testified against you" (2 Samuel 1:16). "From generation to generation" (Exodus 17:16). The Holy One, blessed be He, said: From generation to generation I am after him, for generations of generations. "From generation to generation" - from the generation of this world to the generation of the world to come; so says Rabbi Yehoshua. Rabbi Elazar of Modi'in says: From the generation of Samuel to the generation of the Messiah, which contains three generations. And how do we know it contains three generations? As it is said (Psalms 72:5): "They shall fear You while the sun endures, and before the moon, for a generation of generations."
The Hand Upon God's Throne and the Oath Against Amalek
Mekhilta DeRabbi Shimon Ben Yochai 17:16
ויאמר כי יד על כס יה משישב על כס יה ותהא מלחמה שליה באותה שעה מלחמה לה' בעמלק: מיכאן מנוי מלך קודם להכרתת זרעו של עמלק כך דברי ר' יהושע: ר' אלעזר המודעי אומר נשבע הקב״ה בכסאו שאם יבואו כל אומות העולם להתגייר יקבלו מהן ומעמלק לא יקבלו מהן שנ' (עי ש"ב א' י"ג) ויאמר דוד אל הנער המגיד לו מי אתה ויאמר בן איש גר עמלקי אנכי באותה שעה נזכר דויד מה נאמר למשה רבו שאם יבואו מכל אומות העולם להתגייר יקבלו מהן ישראל ועמלק לא יקבלו מהן ויאמר לו דוד דמך על ראשך פיך ענה בך (ע' שם ט"ז): מדר דר אמר הקב״ה מן דר ודר אנא בתריה לדר דרין: מדור דור מדור העולם הזה לדור העולם הבא כך דברי ר' יהושע: ר' אלעזר המודעי אומר מדורו של שמואל לדורו של משיח שיש בו שלשה דורות ומנין שיש בו שלשה דורות שנ' (תהלים ע"ב ה') ייראוך עם שמש ולפני יריח דור דורים: