It Happened at Midnight
A deeper look at the famous Passover poem in the context of late night learning for Shavuot
Origins of all night learning on Shavuot - vulnerability, trepidation, and spiritual elevation.
The practice of learning Torah late into the night on Shavuot has been done for at least 500 years. This 16th-century ethical and theological treatise reproduces a letter originally written by famous kabbalist Rabbi Shlomo Alkebetz (16th century, Israel), describing staying up all night on Shavuot learning with Rav Yosef Karo.

(Source: Shenei Luchot Habrit, Aseret Hadibrot, Shavuot, Ner Mitzvah)
יג) דעו לכם כי הסכמנו החסיד נר"ו ואני עבדו ועבידכם מהחברים לעמוד על נפשינו ליל שבועות ולנדד שינה מעינינו, ותהלות לה' כן עלה בידינו כי לא הפסקנו רגע רק אשר תשמעו ותחי נפשכם, וזהו הסדר שתקנתי וסדרתי. בלילה ההוא ראשונה תורה קרינן מפרשת בראשית, עד (בראשית ב, א) ויכולו בנעימה בקול גדול. אחר כך בחודש השלישי (שמות יט, א) עד סוף סידרא. עוד מפרשת משפטים (שם כד, א) ואל משה אמר, עד סוף סידרא. עוד מפרשת ואתחנן (דברים ה, א) ויקרא משה אל כל ישראל, עד סוף פרשת שמע ישראל (שם ו, ט). עוד מפרשת וזאת הברכה (שם לד, א) ויעל משה עד לעיני כל ישראל. עוד ההפטרה (יחזקאל א, א) ויהי בשלושים שנה. והפטרה תפילה לחבקוק הנביא (חבקוק ג, א). אח"כ (תהילים י״ט:ב׳) מזמור השמים מספרים, ומזמור יקום אלקים (שם סח). אח"כ האלפא ביתא (שם קיט) בלא השירות (מפרק קכ). אח"כ כל מגילות שיר השירים וכל מגילות רות. ואחר כך פסוקים אחרונים של דברי הימים. וכל זה באימה ביראה בניגון בטעם לא יאומן כי יסופר. ואחר כך למדנו משנה כל סדר זרעים, ואחר כך למדנו על דרך האמת:
(יד) ובעת שהתחלנו ללמוד המשנה ולמדנו שתי מסכתות, זיכנו בוראנו ונשמע את קול המדבר בפי החסיד נר"ו קול גדול בחיתוך אותיות, וכל השכנים היו שומעים ולא מבינים, והיה הנעימות רב והקול הולך וחזק, ונפלנו על פנינו ולא היה רוח באיש לישא עיניו ופניו לראות מרוב המורא והדיבור ההוא מדבר עמנו והתחיל ואמר, שמעו ידידי המהדרים מן המהדרים, ידידי אהובי שלום לכם אשריכם ואשרי ילדתכם, אשריכם בעולם הזה אשריכם בעולם הבא אשר שמתם על נפשיכם לעטרני בלילה הזה אשר זה כמה שנים נפלה עטרת ראשי ואין מנחם לי, ואני מושלכת בעפר חובקת אשפתות, ועתה החזרתם עטרה ליושנה...
(13) Know - that the pious one (R. Yosef Karo) and I agreed to make a great effort on the night of Shavuot, and to keep sleep from our eyes. Praise to God, so it was. We didn't stop one moment - listen, and your soul will be revived...[see original for lengthy, specific list of texts learned]
(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..."
Can you think of another story of rabbinic study all night?
My favorite Jewish poem of all time, incidentally about these same themes...
וּבְכֵן וַיְהִי בַּחֲצִי הַלַּיְלָה.
And so, it was in the middle of the night.
The night, practically and spiritually, as a time for vigilance.

אָז רוֹב נִסִּים הִפְלֵאתָ בַּלַּיְלָה, בְּרֹאשׁ אַשְׁמוֹרֶת זֶה הַלַּיְלָה.

Then, most of the miracles did You wondrously do at night, at the first of the watches this night.
לְעוֹלָם קָסָבַר שָׁלֹשׁ מִשְׁמָרוֹת הָוֵי הַלַּיְלָה, וְהָא קָמַשְׁמַע לָן: דְּאִיכָּא מִשְׁמָרוֹת בָּרָקִיעַ וְאִיכָּא מִשְׁמָרוֹת בְּאַרְעָא. דְּתַנְיָא, רַבִּי אֱלִיעֶזֶר אוֹמֵר: שָׁלֹשׁ מִשְׁמָרוֹת הָוֵי הַלַּיְלָה, וְעַל כָּל מִשְׁמָר וּמִשְׁמָר יוֹשֵׁב הַקָּדוֹשׁ בָּרוּךְ הוּא וְשׁוֹאֵג כָּאֲרִי, שֶׁנֶּאֱמַר: ״ה׳ מִמָּרוֹם יִשְׁאָג, וּמִמְּעוֹן קָדְשׁוֹ יִתֵּן קוֹלוֹ שָׁאֹג יִשְׁאַג עַל נָוֵהוּ״.

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.

The "three night watches" have roots in the idea that there was a changing guard throughout the night to protect the community, and there are references to it intermittently throughout nevi'im and ketubim. This was a concept taken for granted during that time. It is discussed in relation to prayer and mitzvot in many contexts. We won't get into that now...

(מב) לֵ֣יל שִׁמֻּרִ֥ים הוּא֙ לַֽה' לְהוֹצִיאָ֖ם מֵאֶ֣רֶץ מִצְרָ֑יִם הֽוּא־הַלַּ֤יְלָה הַזֶּה֙ לַֽה' שִׁמֻּרִ֛ים לְכׇל־בְּנֵ֥י יִשְׂרָאֵ֖ל לְדֹרֹתָֽם׃ {פ}

(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.

What then, do you make of the phrase "Leil Shimurim?" (night of vigil?). Who is doing the watching?
Leil Shimurim throughout history.
גֵר צֶדֶק נִצַּחְתּוֹ כְּנֶחֶלַק לוֹ לַיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.

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.

(יד) וַיִּשְׁמַ֣ע אַבְרָ֔ם כִּ֥י נִשְׁבָּ֖ה אָחִ֑יו וַיָּ֨רֶק אֶת־חֲנִיכָ֜יו יְלִידֵ֣י בֵית֗וֹ שְׁמֹנָ֤ה עָשָׂר֙ וּשְׁלֹ֣שׁ מֵא֔וֹת וַיִּרְדֹּ֖ף עַד־דָּֽן׃ (טו) וַיֵּחָלֵ֨ק עֲלֵיהֶ֧ם ׀ לַ֛יְלָה ה֥וּא וַעֲבָדָ֖יו וַיַּכֵּ֑ם וַֽיִּרְדְּפֵם֙ עַד־חוֹבָ֔ה אֲשֶׁ֥ר מִשְּׂמֹ֖אל לְדַמָּֽשֶׂק׃ (טז) וַיָּ֕שֶׁב אֵ֖ת כׇּל־הָרְכֻ֑שׁ וְגַם֩ אֶת־ל֨וֹט אָחִ֤יו וּרְכֻשׁוֹ֙ הֵשִׁ֔יב וְגַ֥ם אֶת־הַנָּשִׁ֖ים וְאֶת־הָעָֽם׃
(14) When Abram heard that his kinsman’s [household] had been taken captive, he mustered his retainers, born into his household, numbering three hundred and eighteen, and went in pursuit as far as Dan. (15) At night, he and his servants deployed against them and defeated them; and he pursued them as far as Hobah, which is north of Damascus. (16) He brought back all the possessions; he also brought back his kinsman Lot and his possessions, and the women and the rest of the people.
דַּנְתָּ מֶלֶךְ גְּרָר בַּחֲלוֹם הַלַּיְלָה, הִפְחַדְתָּ אֲרַמִּי בְּאֶמֶשׁ לַיְלָה.
You judged the king of Gerrar [Avimelekh] in a dream of the night; you frightened an Aramean [Lavan] in the dark 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?

(יז) וַיָּ֖קׇם יַעֲקֹ֑ב וַיִּשָּׂ֛א אֶת־בָּנָ֥יו וְאֶת־נָשָׁ֖יו עַל־הַגְּמַלִּֽים׃ (יח) וַיִּנְהַ֣ג אֶת־כׇּל־מִקְנֵ֗הוּ וְאֶת־כׇּל־רְכֻשׁוֹ֙ אֲשֶׁ֣ר רָכָ֔שׁ מִקְנֵה֙ קִנְיָנ֔וֹ אֲשֶׁ֥ר רָכַ֖שׁ בְּפַדַּ֣ן אֲרָ֑ם לָב֛וֹא אֶל־יִצְחָ֥ק אָבִ֖יו אַ֥רְצָה כְּנָֽעַן׃ (יט) וְלָבָ֣ן הָלַ֔ךְ לִגְזֹ֖ז אֶת־צֹאנ֑וֹ וַתִּגְנֹ֣ב רָחֵ֔ל אֶת־הַתְּרָפִ֖ים אֲשֶׁ֥ר לְאָבִֽיהָ׃ (כ) וַיִּגְנֹ֣ב יַעֲקֹ֔ב אֶת־לֵ֥ב לָבָ֖ן הָאֲרַמִּ֑י עַל־בְּלִי֙ הִגִּ֣יד ל֔וֹ כִּ֥י בֹרֵ֖חַ הֽוּא׃ (כא) וַיִּבְרַ֥ח הוּא֙ וְכׇל־אֲשֶׁר־ל֔וֹ וַיָּ֖קׇם וַיַּעֲבֹ֣ר אֶת־הַנָּהָ֑ר וַיָּ֥שֶׂם אֶת־פָּנָ֖יו הַ֥ר הַגִּלְעָֽד׃ (כב) וַיֻּגַּ֥ד לְלָבָ֖ן בַּיּ֣וֹם הַשְּׁלִישִׁ֑י כִּ֥י בָרַ֖ח יַעֲקֹֽב׃ (כג) וַיִּקַּ֤ח אֶת־אֶחָיו֙ עִמּ֔וֹ וַיִּרְדֹּ֣ף אַחֲרָ֔יו דֶּ֖רֶךְ שִׁבְעַ֣ת יָמִ֑ים וַיַּדְבֵּ֥ק אֹת֖וֹ בְּהַ֥ר הַגִּלְעָֽד׃ (כד) וַיָּבֹ֧א אֱלֹקִ֛ים אֶל־לָבָ֥ן הָאֲרַמִּ֖י בַּחֲלֹ֣ם הַלָּ֑יְלָה וַיֹּ֣אמֶר ל֗וֹ הִשָּׁ֧מֶר לְךָ֛ פֶּן־תְּדַבֵּ֥ר עִֽם־יַעֲקֹ֖ב מִטּ֥וֹב עַד־רָֽע׃
(17) Thereupon Jacob put his children and wives on camels; (18) and he drove off all his livestock and all the wealth that he had amassed, the livestock in his possession that he had acquired in Paddan-aram, to go to his father Isaac in the land of Canaan. (19) Meanwhile Laban had gone to shear his sheep, and Rachel stole her father’s household idols. (20) Jacob kept Laban the Aramean in the dark, not telling him that he was fleeing, (21) and fled with all that he had. Soon he was across the Euphrates and heading toward the hill country of Gilead. (22) On the third day, Laban was told that Jacob had fled. (23) So he took his kinsmen with him and pursued him a distance of seven days, catching up with him in the hill country of Gilead. (24) But God appeared to Laban the Aramean in a dream by night and said to him, “Beware of attempting anything with Jacob, good or bad.”
וַיָּשַׂר יִשְׂרָאֵל לְמַלְאָךְ וַיּוּכַל לוֹ לַיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.
and Yisrael dominated an angel and was able to withstand Him at night [Genesis 32:25-30], and it was in the middle of the night.

(כה) וַיִּוָּתֵ֥ר יַעֲקֹ֖ב לְבַדּ֑וֹ וַיֵּאָבֵ֥ק אִישׁ֙ עִמּ֔וֹ עַ֖ד עֲל֥וֹת הַשָּֽׁחַר׃ (כו) וַיַּ֗רְא כִּ֣י לֹ֤א יָכֹל֙ ל֔וֹ וַיִּגַּ֖ע בְּכַף־יְרֵכ֑וֹ וַתֵּ֙קַע֙ כַּף־יֶ֣רֶךְ יַעֲקֹ֔ב בְּהֵאָֽבְק֖וֹ עִמּֽוֹ׃ (כז) וַיֹּ֣אמֶר שַׁלְּחֵ֔נִי כִּ֥י עָלָ֖ה הַשָּׁ֑חַר וַיֹּ֙אמֶר֙ לֹ֣א אֲשַֽׁלֵּחֲךָ֔ כִּ֖י אִם־בֵּרַכְתָּֽנִי׃ (כח) וַיֹּ֥אמֶר אֵלָ֖יו מַה־שְּׁמֶ֑ךָ וַיֹּ֖אמֶר יַעֲקֹֽב׃ (כט) וַיֹּ֗אמֶר לֹ֤א יַעֲקֹב֙ יֵאָמֵ֥ר עוֹד֙ שִׁמְךָ֔ כִּ֖י אִם־יִשְׂרָאֵ֑ל כִּֽי־שָׂרִ֧יתָ עִם־אֱלֹקִ֛ים וְעִם־אֲנָשִׁ֖ים וַתּוּכָֽל׃ (ל) וַיִּשְׁאַ֣ל יַעֲקֹ֗ב וַיֹּ֙אמֶר֙ הַגִּֽידָה־נָּ֣א שְׁמֶ֔ךָ וַיֹּ֕אמֶר לָ֥מָּה זֶּ֖ה תִּשְׁאַ֣ל לִשְׁמִ֑י וַיְבָ֥רֶךְ אֹת֖וֹ שָֽׁם׃

(25) Jacob was left alone. And a figure wrestled with him until the break of dawn. (26) When he saw that he had not prevailed against him, he wrenched Jacob’s hip at its socket, so that the socket of his hip was strained as he wrestled with him. (27) Then he said, “Let me go, for dawn is breaking.” But he answered, “I will not let you go, unless you bless me.” (28) Said the other, “What is your name?” He replied, “Jacob.” (29) Said he, “Your name shall no longer be Jacob, but Israel, for you have striven with beings divine and human, and have prevailed.” (30) Jacob asked, “Pray tell me your name.” But he said, “You must not ask my name!” And he took leave of him there.
זֶרַע בְּכוֹרֵי פַתְרוֹס מָחַצְתָּ בַּחֲצִי הַלַּיְלָה, חֵילָם לֹא מָצְאוּ בְּקוּמָם בַּלַּיְלָה, טִיסַת נְגִיד חֲרֹשֶׁת סִלִּיתָ בְּכוֹכְבֵי לַיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.
You crushed the firstborn of Patros [Pharaoh, as per Ezekiel 30:14] in the middle of the night, their wealth they did not find when they got up at night; the attack of the leader Charoshet [Sisera] did you sweep away by the stars of the night [Judges 5:20], and it was in the middle of the night.
(יד) וַֽהֲשִׁמֹּתִי֙ אֶת־פַּתְר֔וֹס וְנָתַ֥תִּי אֵ֖שׁ בְּצֹ֑עַן וְעָשִׂ֥יתִי שְׁפָטִ֖ים בְּנֹֽא׃
(14) I will lay Pathros waste, I will set fire to Zoan, and I will execute judgment on No.
(כט) וַיְהִ֣י ׀ בַּחֲצִ֣י הַלַּ֗יְלָה וַֽה' הִכָּ֣ה כׇל־בְּכוֹר֮ בְּאֶ֣רֶץ מִצְרַ֒יִם֒ מִבְּכֹ֤ר פַּרְעֹה֙ הַיֹּשֵׁ֣ב עַל־כִּסְא֔וֹ עַ֚ד בְּכ֣וֹר הַשְּׁבִ֔י אֲשֶׁ֖ר בְּבֵ֣ית הַבּ֑וֹר וְכֹ֖ל בְּכ֥וֹר בְּהֵמָֽה׃
(29) In the middle of the night ה' struck down all the [male] first-born in the land of Egypt, from the first-born of Pharaoh who sat on the throne to the first-born of the captive who was in the dungeon, and all the first-born of the cattle.
יָעַץ מְחָרֵף לְנוֹפֵף אִוּוּי, הוֹבַשְׁתָּ פְגָרָיו בַּלַּיְלָה, כָּרַע בֵּל וּמַצָּבוֹ בְּאִישׁוֹן לַיְלָה, לְאִישׁ חֲמוּדוֹת נִגְלָה רָז חֲזוֹת לַיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.
The blasphemer [Sancheriv whose servants blasphemed when trying to discourage the inhabitants of Jerusalem] counseled to wave off the desired ones, You made him wear his corpses on his head at night [II Kings 19:35]; Bel and his pedestal were bent in the pitch of night [in Nevuchadnezar's dream in Daniel 2]; to the man of delight [Daniel] was revealed the secret visions at night, and it was in the middle of the night.
וַיְהִי֮ בַּלַּ֣יְלָה הַהוּא֒ וַיֵּצֵ֣א ׀ מַלְאַ֣ךְ ה' וַיַּךְ֙ בְּמַחֲנֵ֣ה אַשּׁ֔וּר מֵאָ֛ה שְׁמוֹנִ֥ים וַחֲמִשָּׁ֖ה אָ֑לֶף וַיַּשְׁכִּ֣ימוּ בַבֹּ֔קֶר וְהִנֵּ֥ה כֻלָּ֖ם פְּגָרִ֥ים מֵתִֽים׃
That night an angel of GOD went out and struck down one hundred and eighty-five thousand in the Assyrian camp, and the following morning they were all dead corpses.
(מד) וּֽבְיוֹמֵיה֞וֹן דִּ֧י מַלְכַיָּ֣א אִנּ֗וּן יְקִים֩ אֱלָ֨הּ שְׁמַיָּ֤א מַלְכוּ֙ דִּ֤י לְעָלְמִין֙ לָ֣א תִתְחַבַּ֔ל וּמַ֨לְכוּתָ֔ה לְעַ֥ם אׇחֳרָ֖ן לָ֣א תִשְׁתְּבִ֑ק תַּדִּ֤ק וְתָסֵיף֙ כׇּל־אִלֵּ֣ין מַלְכְוָתָ֔א וְהִ֖יא תְּק֥וּם לְעָלְמַיָּֽא׃
(44) And in the time of those kings, the God of Heaven will establish a kingdom that shall never be destroyed, a kingdom that shall not be transferred to another people. It will crush and wipe out all these kingdoms, but shall itself last forever—
מִשְׁתַּכֵּר בִּכְלֵי קֹדֶשׁ נֶהֱרַג בּוֹ בַלַּיְלָה, נוֹשַׁע מִבּוֹר אֲרָיוֹת פּוֹתֵר בִּעֲתוּתֵי לַיְלָה, שִׂנְאָה נָטַר אֲגָגִי וְכָתַב סְפָרִים בַּלַּיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.
The one who got drunk [Balshatsar] from the holy vessels was killed on that night [Daniel 5:30], the one saved from the pit of lions [Daniel] interpreted the scary visions of the night; hatred was preserved by the Agagite [Haman] and he wrote books at night, and it was in the middle of the night.

(א) בֵּלְשַׁאצַּ֣ר מַלְכָּ֗א עֲבַד֙ לְחֶ֣ם רַ֔ב לְרַבְרְבָנ֖וֹהִי אֲלַ֑ף וְלׇקֳבֵ֥ל אַלְפָּ֖א חַמְרָ֥א שָׁתֵֽה׃ (ב) בֵּלְשַׁאצַּ֞ר אֲמַ֣ר ׀ בִּטְעֵ֣ם חַמְרָ֗א לְהַיְתָיָה֙ לְמָאנֵי֙ דַּהֲבָ֣א וְכַסְפָּ֔א דִּ֤י הַנְפֵּק֙ נְבוּכַדְנֶצַּ֣ר אֲב֔וּהִי מִן־הֵיכְלָ֖א דִּ֣י בִירוּשְׁלֶ֑ם וְיִשְׁתּ֣וֹן בְּה֗וֹן מַלְכָּא֙ וְרַבְרְבָנ֔וֹהִי שֵׁגְלָתֵ֖הּ וּלְחֵנָתֵֽהּ׃ ... (ה) בַּהּ־שַׁעֲתָ֗ה (נפקו) [נְפַ֙קָה֙] אֶצְבְּעָן֙ דִּ֣י יַד־אֱנָ֔שׁ וְכָֽתְבָן֙ לׇקֳבֵ֣ל נֶבְרַשְׁתָּ֔א עַל־גִּירָ֕א דִּֽי־כְתַ֥ל הֵיכְלָ֖א דִּ֣י מַלְכָּ֑א וּמַלְכָּ֣א חָזֵ֔ה פַּ֥ס יְדָ֖א דִּ֥י כָתְבָֽה׃... (ז) קָרֵ֤א מַלְכָּא֙ בְּחַ֔יִל לְהֶֽעָלָה֙ לְאָ֣שְׁפַיָּ֔א (כשדיא) [כַּשְׂדָּאֵ֖י] וְגָזְרַיָּ֑א עָנֵ֨ה מַלְכָּ֜א וְאָמַ֣ר ׀ לְחַכִּימֵ֣י בָבֶ֗ל דִּ֣י כׇל־אֱ֠נָ֠שׁ דִּֽי־יִקְרֵ֞ה כְּתָבָ֣ה דְנָ֗ה וּפִשְׁרֵהּ֙ יְחַוִּנַּ֔נִי אַרְגְּוָנָ֣א יִלְבַּ֗שׁ (והמנוכא) [וְהַֽמְנִיכָ֤א] דִֽי־דַהֲבָא֙ עַֽל־צַוְּארֵ֔הּ וְתַלְתִּ֥י בְמַלְכוּתָ֖א יִשְׁלַֽט׃ {ס}

(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.”

(כט) בֵּאדַ֣יִן ׀ אֲמַ֣ר בֵּלְשַׁאצַּ֗ר וְהַלְבִּ֤שׁוּ לְדָֽנִיֵּאל֙ אַרְגְּוָנָ֔א (והמנוכא) [וְהַֽמְנִיכָ֥א] דִֽי־דַהֲבָ֖א עַֽל־צַוְּארֵ֑הּ וְהַכְרִ֣זֽוּ עֲל֔וֹהִי דִּֽי־לֶהֱוֵ֥א שַׁלִּ֛יט תַּלְתָּ֖א בְּמַלְכוּתָֽא׃ (ל) בֵּ֚הּ בְּלֵ֣ילְיָ֔א קְטִ֕יל בֵּלְאשַׁצַּ֖ר מַלְכָּ֥א (כשדיא) [כַשְׂדָּאָֽה]׃ {פ}
(29) Then, at Belshazzar’s command, they clothed Daniel in purple, placed a golden chain on his neck, and proclaimed that he should rule as one of three in the kingdom. (30) That very night, Belshazzar, the Chaldean king, was killed,
עוֹרַרְתָּ נִצְחֲךָ עָלָיו בְּנֶדֶד שְׁנַת לַיְלָה. פּוּרָה תִדְרוֹךְ לְשׁוֹמֵר מַה מִּלַיְלָה, צָרַח כַּשּׁוֹמֵר וְשָׂח אָתָא בֹקֶר וְגַם לַיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.
You aroused your victory upon him by disturbing the sleep of night [of Achashverosh], You will stomp the wine press for the one who guards from anything at night [Esav/Seir as per Isaiah 21:11]; He yelled like a guard and spoke, "the morning has come and also the night," and it was in the middle of the night.
בַּלַּ֣יְלָה הַה֔וּא נָדְדָ֖ה שְׁנַ֣ת הַמֶּ֑לֶךְ וַיֹּ֗אמֶר לְהָבִ֞יא אֶת־סֵ֤פֶר הַזִּכְרֹנוֹת֙ דִּבְרֵ֣י הַיָּמִ֔ים וַיִּהְי֥וּ נִקְרָאִ֖ים לִפְנֵ֥י הַמֶּֽלֶךְ׃

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.

(יא) מַשָּׂ֖א דּוּמָ֑ה אֵלַי֙ קֹרֵ֣א מִשֵּׂעִ֔יר שֹׁמֵר֙ מַה־מִּלַּ֔יְלָה שֹׁמֵ֖ר מַה־מִּלֵּֽיל׃ (יב) אָמַ֣ר שֹׁמֵ֔ר אָתָ֥ה בֹ֖קֶר וְגַם־לָ֑יְלָה אִם־תִּבְעָי֥וּן בְּעָ֖יוּ שֻׁ֥בוּ אֵתָֽיוּ׃ {פ}
(11) The “Dumah” Pronouncement.
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.”
Day and night as reference to redemption and messianic times.

מָה רָאָה לוֹמַר לֵיל שִׁמֻּרִים, שֶׁבּוֹ עָשָׂה גְּדֻלָּה לַצַּדִּיקִים, כְּשֵׁם שֶׁעָשָׂה לְיִשְׂרָאֵל בְּמִצְרַיִם, וּבוֹ הִצִּיל לְחִזְקִיָּהוּ, וּבוֹ הִצִּיל לַחֲנַנְיָה וַחֲבֵרָיו, וּבוֹ הִצִּיל לְדָנִיֵּאל מִגֹּב אֲרָיוֹת, וּבוֹ מָשִׁיחַ וְאֵלִיָּהוּ הַנָּבִיא מִתְגַּדְּלִין, שֶׁנֶּאֱמַר (ישעיה כא, יב): אָמַר שֹׁמֵר אָתָא בֹקֶר וְגַם לָיְלָה.

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.'"

קָרֵב יוֹם אֲשֶׁר הוּא לֹא יוֹם וְלֹא לַיְלָה, רָם הוֹדַע כִּי לְךָ הַיּוֹם אַף לְךָ הַלַּיְלָה, שׁוֹמְרִים הַפְקֵד לְעִירְךָ כָּל הַיּוֹם וְכָל הַלַּיְלָה, תָּאִיר כְּאוֹר יוֹם חֶשְׁכַּת לַיְלָה, וַיְהִי בַּחֲצִי הַלַּיְלָה.
Bring close the day which is not day and not night [referring to the end of days - Zechariah 14:7], High One, make known that Yours is the day and also Yours is the night, guards appoint for Your city all the day and all the night, illuminate like the light of the day, the darkness of the night, and it was in the middle of the night.
(ו) וְהָיָ֖ה בַּיּ֣וֹם הַה֑וּא לֹֽא־יִֽהְיֶ֣ה א֔וֹר יְקָר֖וֹת (יקפאון) [וְקִפָּאֽוֹן]׃ (ז) וְהָיָ֣ה יוֹם־אֶחָ֗ד ה֛וּא יִוָּדַ֥ע לַה' לֹא־י֣וֹם וְלֹא־לָ֑יְלָה וְהָיָ֥ה לְעֵֽת־עֶ֖רֶב יִֽהְיֶה־אֽוֹר׃
(6) In that day, there shall be neither sunlight nor cold moonlight, (7) but there shall be a continuous day—only GOD knows when—of neither day nor night, and there shall be light at eventide.
Can you find any themes in the selected episodes?
Context of the poem (TheTorah.com)
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
About the Author: Yannai was a paytan (liturgical poet) of the Byzantine empire, who may have lived in Eretz Yisrael. He is considered one of the three greatest early paytanim, along with Yose ben Yose and Eleazar Hakalir. He was the first to use rhyme and introduced the convention of alluding to his name in acrostics. He was evidently a very prolific poet, though much of his work has been lost. A manuscript of his poems was discovered in the Cairo geniza and published in 1938.
Incidentally...bringing this back to Shavuot
(ח) וַֽיְהִי֙ בַּחֲצִ֣י הַלַּ֔יְלָה וַיֶּחֱרַ֥ד הָאִ֖ישׁ וַיִּלָּפֵ֑ת וְהִנֵּ֣ה אִשָּׁ֔ה שֹׁכֶ֖בֶת מַרְגְּלֹתָֽיו׃
(8) In the middle of the night, the man gave a start and pulled back—there was a woman lying at his feet!