(Ps. 79:12:) [And] return sevenfold to the bosom of our neighbors their reproach <with which they have reproached you, O Lord>. R. Yudan bar Gadya, R. Yehoshua ben Levi, and the Rabbis [differ]. R. Yudan bar Gadya said: He will remember what they did to us regarding the circumcision, which is set in a man's bosom. And this agrees with what R. Hanina bar Shilka and R. Yehoshua of Sikhnin and R. Levi said in the name of R. Yohanan: What did the household of Amalek do to Israel? They would cut off their circumcisions and throw them upward and say, "Here is for you what you chose." R. Yehoshua [ben Levi] said: He will remember for them what they did in the Temple, which is the bosom of the world, as it is said, "And from the bosom of the ground up to the lower ledge <was two cubits>" (Ezek. 43:14). Samuel came and paid them back, as it is said, "And Samuel hewed Agag <in pieces before the Lord in Gilgal>" (1 Sam. 15:33). What did he do to him? R. Abba bar Kahana said: He cut his flesh into pieces, olive-sized, olive-sized, and fed them to the ostriches. This is what is written, "It shall consume the limbs of his skin; the firstborn of death shall consume his limbs" (Job 18:13)—he chose for him a bitter death. And the Rabbis said: He set up four stakes and stretched him out upon them, while he [Agag] said, "Surely the bitterness of death is past" (1 Sam. 15:32)—thus do they put princes to death by severe deaths. And R. Samuel bar Avdimi said: He judged him by the law of the nations of the world, neither with witnesses nor with warning. R. Yitzhak said: He castrated him, as it is said, "And Samuel said, As your sword has bereaved women <so shall your mother be bereaved among women>" (1 Sam. 15:33). R. Levi said: The Torah too hinted this to Israel, as it is said, "When men strive together <one with another>" (Deut. 25:11), "and she puts out her hand and seizes him by his private parts, then you shall cut off her hand <your eye shall have no pity>" (Deut. 25:11–12). What is written after it? "Remember what Amalek did to you" (Deut. 25:17).
Why Samuel Slew Agag and How Israel Remembers Amalek
Midrash Tanchuma Buber, Ki Teitzei 10:1
(השב) [והשב] לשכנינו שבעתים אל היקם הרפתם וגו' (תהלים עט יב), ר' יודן בר גדיא ור' יהושע בן לוי ורבנן, ר' יודן בר גדיא אמר יזכר מה שעשה לנו במילה, שהיא נתונה בחיקו של אדם, ואתיא כי האי דאמר ר' חנינא בר שלקא ור' יהושע דסכנין ור' לוי בשם ר' יוחנן, מה היו עושין בני ביתו של עמלק לישראל, היו מחתכין מילותיהן, והיו זורקין כלפי למעלה, ואומרין הא לך מה שבחרת. ר' יהושע [בן לוי] אמר יזכר להם מה שעשו בבית המקדש, שהוא חיקו של עולם, שנאמר ומחיק הארץ עד העזרה וגו' (יחזקאל מג יד), בא שמואל ופרע להם, שנאמר וישסף שמואל את אגג וגו' (ש"א טו לג), מה עשה לו, ר' אבא בר כהנא אמר היה מחתך בבשור כזיתים כזיתים, והיה מאכיל לנעמיות, הה"ד יאכל בדי עורו יאכל בדיו בכור מות (איוב יחי ג), ביכר לו מיתה מרה, ורבנן אמרי העמיד ארבע קונדסין ומתחו עליהם, והוא אומר אכן סר מר המות (ש"א טו לב), כך ממיתין את השרים מיתות חמורות, ור' שמואל בר אבדימי אמר בדיני אומות העולם דנו, לא בעדים ולא בהתראה, ר' יצחק אמר סירסו, שנאמר ויאמר שמואל כאשר שיכלה נשים חרבך וגו' (שם שם לג), אמר ר' לוי אף התורה רמזה להם לישראל, שנאמר כי ינצו אנשים יחדו וגו' (דברים כה יא), ושלחה ידה והחזיקה במבושיו וקצותה את כפה וגו' (שם שם יא יב), מה כתיב אחריו, זכור את אשר עשה לך עמלק.