(Source: Shenei Luchot Habrit, Aseret Hadibrot, Shavuot, Ner Mitzvah)
(יד) ובעת שהתחלנו ללמוד המשנה ולמדנו שתי מסכתות, זיכנו בוראנו ונשמע את קול המדבר בפי החסיד נר"ו קול גדול בחיתוך אותיות, וכל השכנים היו שומעים ולא מבינים, והיה הנעימות רב והקול הולך וחזק, ונפלנו על פנינו ולא היה רוח באיש לישא עיניו ופניו לראות מרוב המורא והדיבור ההוא מדבר עמנו והתחיל ואמר, שמעו ידידי המהדרים מן המהדרים, ידידי אהובי שלום לכם אשריכם ואשרי ילדתכם, אשריכם בעולם הזה אשריכם בעולם הבא אשר שמתם על נפשיכם לעטרני בלילה הזה אשר זה כמה שנים נפלה עטרת ראשי ואין מנחם לי, ואני מושלכת בעפר חובקת אשפתות, ועתה החזרתם עטרה ליושנה...
(14) The moment that we began to learn the Mishnah, and we learned two tractates, our Creator graced us and we heard a voice speaking from the mouth of the pious one. A great voice, with clear enunciation, and all around us heard but did not understand. It was very pleasant, and the voice gained strength. We fell on our faces, and none could raise their eyes from fear. The voice speaking to us began and said - "Hear my beloved ones, most beautiful, cherished, beloved, peace to you, fortunate are you and those that bore you, fortunate in this world and in the world to come, in that you took upon yourselves to crown me this night. It is many years that my crown has fallen from my head, and I have no one to comfort me, and I am cast to the dirt clutching waste piles. But you have returned the crown to its former glory..."
אָז רוֹב נִסִּים הִפְלֵאתָ בַּלַּיְלָה, בְּרֹאשׁ אַשְׁמוֹרֶת זֶה הַלַּיְלָה.
The Gemara responds: Actually, Rabbi Eliezer holds that the night consists of three watches, and he employs this particular language of watches in order to teach us: There are watches in heaven and there are watches on earth; just as our night is divided into watches, so too is the night in the upper worlds. As it was taught in a baraita: Rabbi Eliezer says: The night consists of three watches, and over each and every watch, the Holy One, Blessed be He, sits and roars like a lion in pain over the destruction of the Temple. This imagery is derived from a reference in the Bible, as it is stated: “The Lord roars [yishag] from on high, from His holy dwelling He makes His voice heard. He roars mightily [shaog yishag] over His dwelling place, He cries out like those who tread grapes, against all the inhabitants of the earth” (Jeremiah 25:30). The three instances of the root shin-alef-gimmel in this verse correspond to the three watches of the night.
(מב) לֵ֣יל שִׁמֻּרִ֥ים הוּא֙ לַֽה' לְהוֹצִיאָ֖ם מֵאֶ֣רֶץ מִצְרָ֑יִם הֽוּא־הַלַּ֤יְלָה הַזֶּה֙ לַֽה' שִׁמֻּרִ֛ים לְכׇל־בְּנֵ֥י יִשְׂרָאֵ֖ל לְדֹרֹתָֽם׃ {פ}
(42) That was for ה' a night of vigil to bring them out of the land of Egypt; that same night is ה’s, one of vigil for all the children of Israel throughout the ages.
A righteous convert did you make victorious when it was divided for him at night [referring to Avraham in his war against the four kings - Genesis 14:15], and it was in the middle of the night.
(1) Abraham journeyed from there to the region of the Negeb and settled between Kadesh and Shur. While he was sojourning in Gerar, (2) Abraham said of Sarah his wife, “She is my sister.” So King Abimelech of Gerar had Sarah brought to him. (3) But God came to Abimelech in a dream by night and said to him, “You are to die because of the woman that you have taken, for she is a married woman.” (4) Now Abimelech had not approached her. He said, “O lord, will You slay people even though innocent?
(כה) וַיִּוָּתֵ֥ר יַעֲקֹ֖ב לְבַדּ֑וֹ וַיֵּאָבֵ֥ק אִישׁ֙ עִמּ֔וֹ עַ֖ד עֲל֥וֹת הַשָּֽׁחַר׃ (כו) וַיַּ֗רְא כִּ֣י לֹ֤א יָכֹל֙ ל֔וֹ וַיִּגַּ֖ע בְּכַף־יְרֵכ֑וֹ וַתֵּ֙קַע֙ כַּף־יֶ֣רֶךְ יַעֲקֹ֔ב בְּהֵאָֽבְק֖וֹ עִמּֽוֹ׃ (כז) וַיֹּ֣אמֶר שַׁלְּחֵ֔נִי כִּ֥י עָלָ֖ה הַשָּׁ֑חַר וַיֹּ֙אמֶר֙ לֹ֣א אֲשַֽׁלֵּחֲךָ֔ כִּ֖י אִם־בֵּרַכְתָּֽנִי׃ (כח) וַיֹּ֥אמֶר אֵלָ֖יו מַה־שְּׁמֶ֑ךָ וַיֹּ֖אמֶר יַעֲקֹֽב׃ (כט) וַיֹּ֗אמֶר לֹ֤א יַעֲקֹב֙ יֵאָמֵ֥ר עוֹד֙ שִׁמְךָ֔ כִּ֖י אִם־יִשְׂרָאֵ֑ל כִּֽי־שָׂרִ֧יתָ עִם־אֱלֹקִ֛ים וְעִם־אֲנָשִׁ֖ים וַתּוּכָֽל׃ (ל) וַיִּשְׁאַ֣ל יַעֲקֹ֗ב וַיֹּ֙אמֶר֙ הַגִּֽידָה־נָּ֣א שְׁמֶ֔ךָ וַיֹּ֕אמֶר לָ֥מָּה זֶּ֖ה תִּשְׁאַ֣ל לִשְׁמִ֑י וַיְבָ֥רֶךְ אֹת֖וֹ שָֽׁם׃
(א) בֵּלְשַׁאצַּ֣ר מַלְכָּ֗א עֲבַד֙ לְחֶ֣ם רַ֔ב לְרַבְרְבָנ֖וֹהִי אֲלַ֑ף וְלׇקֳבֵ֥ל אַלְפָּ֖א חַמְרָ֥א שָׁתֵֽה׃ (ב) בֵּלְשַׁאצַּ֞ר אֲמַ֣ר ׀ בִּטְעֵ֣ם חַמְרָ֗א לְהַיְתָיָה֙ לְמָאנֵי֙ דַּהֲבָ֣א וְכַסְפָּ֔א דִּ֤י הַנְפֵּק֙ נְבוּכַדְנֶצַּ֣ר אֲב֔וּהִי מִן־הֵיכְלָ֖א דִּ֣י בִירוּשְׁלֶ֑ם וְיִשְׁתּ֣וֹן בְּה֗וֹן מַלְכָּא֙ וְרַבְרְבָנ֔וֹהִי שֵׁגְלָתֵ֖הּ וּלְחֵנָתֵֽהּ׃ ... (ה) בַּהּ־שַׁעֲתָ֗ה (נפקו) [נְפַ֙קָה֙] אֶצְבְּעָן֙ דִּ֣י יַד־אֱנָ֔שׁ וְכָֽתְבָן֙ לׇקֳבֵ֣ל נֶבְרַשְׁתָּ֔א עַל־גִּירָ֕א דִּֽי־כְתַ֥ל הֵיכְלָ֖א דִּ֣י מַלְכָּ֑א וּמַלְכָּ֣א חָזֵ֔ה פַּ֥ס יְדָ֖א דִּ֥י כָתְבָֽה׃... (ז) קָרֵ֤א מַלְכָּא֙ בְּחַ֔יִל לְהֶֽעָלָה֙ לְאָ֣שְׁפַיָּ֔א (כשדיא) [כַּשְׂדָּאֵ֖י] וְגָזְרַיָּ֑א עָנֵ֨ה מַלְכָּ֜א וְאָמַ֣ר ׀ לְחַכִּימֵ֣י בָבֶ֗ל דִּ֣י כׇל־אֱ֠נָ֠שׁ דִּֽי־יִקְרֵ֞ה כְּתָבָ֣ה דְנָ֗ה וּפִשְׁרֵהּ֙ יְחַוִּנַּ֔נִי אַרְגְּוָנָ֣א יִלְבַּ֗שׁ (והמנוכא) [וְהַֽמְנִיכָ֤א] דִֽי־דַהֲבָא֙ עַֽל־צַוְּארֵ֔הּ וְתַלְתִּ֥י בְמַלְכוּתָ֖א יִשְׁלַֽט׃ {ס}
(1) King Belshazzar gave a great banquet for his thousand nobles, and in the presence of the thousand he drank wine. (2) Under the influence of the wine, Belshazzar ordered the gold and silver vessels that his father Nebuchadnezzar had taken out of the temple at Jerusalem to be brought so that the king and his nobles, his consorts, and his concubines could drink from them.... (5) Just then, the fingers of a human hand appeared and wrote on the plaster of the wall of the king’s palace opposite the lampstand, so that the king could see the hand as it wrote.... (7) The king called loudly for the exorcists, Chaldeans, and diviners to be brought. The king addressed the wise men of Babylon, “Whoever can read this writing and tell me its meaning shall be clothed in purple and wear a golden chain on his neck, and shall rule as one of three-a in the kingdom.”
That night, sleep deserted the king, and he ordered the book of records, the annals, to be brought; and it was read to the king.
A call comes to me from Seir:
“Watchman, what of the night?
Watchman, what of the night?” (12) The watchman replied,
“Morning came, and so did night.
If you would inquire, inquire.
Come back again.”
מָה רָאָה לוֹמַר לֵיל שִׁמֻּרִים, שֶׁבּוֹ עָשָׂה גְּדֻלָּה לַצַּדִּיקִים, כְּשֵׁם שֶׁעָשָׂה לְיִשְׂרָאֵל בְּמִצְרַיִם, וּבוֹ הִצִּיל לְחִזְקִיָּהוּ, וּבוֹ הִצִּיל לַחֲנַנְיָה וַחֲבֵרָיו, וּבוֹ הִצִּיל לְדָנִיֵּאל מִגֹּב אֲרָיוֹת, וּבוֹ מָשִׁיחַ וְאֵלִיָּהוּ הַנָּבִיא מִתְגַּדְּלִין, שֶׁנֶּאֱמַר (ישעיה כא, יב): אָמַר שֹׁמֵר אָתָא בֹקֶר וְגַם לָיְלָה.
What did it see to state [that it is] "a night of watchings?" That on it He enacted greatness for the righteous in the same way that He did so for the Jews in Egypt. And on it He rescued Hizkiyahu, and on it He rescued Chanania and his fellows, and on it He rescued Daniel from the lion's den, and on it Eliyahu and the Messiah will become great, as it is stated (Isaiah 21:12), "The watchman said, 'the morning has come, and also the night.'"
The Passover Haggadah concludes with a series of songs, the first of which is וַיְהִי בַּחֲצִי הַלַּיְלָה, Vayhi BeChatzi HaLayla, “It Came to Pass at Midnight” (Exod 12:29). The song, however, was not written for Pesach night, nor is it an independent composition. Instead, it was part seven of the poem אוֹנֵי פִטְרֵי רַחֲמָתָיִם (The Vigor of the Openers of Wombs),” composed by Yannai (late 5th–early 6th cent. C.E.), the first Hebrew poet to use end-rhyme and to sign his works with a signature acrostic.[1]
Most of Yannai’s poems, including this one, belong to the genre known as qedushta’ot because they embellish the first three benedictions of the Amidah, culminating in the Qedushah. ...
...According to Exodus, the deaths of all the firstborn of Egypt, and the sparing of the children of Israel, occurred at midnight on the eve of the exodus. Yannai’s qedushta for the sidra of וַיְהִי בַּחֲצִי הַלַּיְלָה, with its temporal consciousness, its relentless appeals to God, and its confidence in divine redemption in the future as in the past, uniquely suits the setting of the Seder, even if that was not the occasion for which it was originally composed.[24]
This particular poem endured because Yannai’s vision of nocturnal redemption and revenge, and its succinct argument that past is prologue and its discernment of patterns in history that assure new rescues yet to come, resonated with Jews in later centuries, especially because the singing of “And it came to pass at midnight” might well come to pass at midnight.
It Came to Pass at Midnight—From the Amidah to the Passover Haggadah - TheTorah.com

