Who cried "Woe"? The Holy One, blessed be He, cried "Woe." To what may the matter be compared? To a king whose son was taken captive. He clothed himself in garments of vengeance against his enemies, and he went and brought him back. He took the captor and hung him on the gallows and began to torment him, saying to him, "Why did you do such a thing to my son?" While he was tormenting him, the captor began to confess and acknowledge [the king]. The king said, "Woe, that this one has acknowledged me! I was seeking to torment him much, and now he has confessed." Immediately he granted him a discharge. So too Pharaoh enslaved Israel in Egypt, and the plagues began to come upon him. And when he sent them out, the Holy One, blessed be He, said, "Woe, that Pharaoh has sent them out," as it is said, "And it came to pass when Pharaoh sent out the people."
The King Who Cried Woe When His Captive Confessed
Yalkut Shimoni on Torah 225:9
מִי קָרָא וַוי, הַקָּדוֹשׁ בָּרוּךְ הוּא קָרָא וַוי, לְמָה הַדָּבָר דּוֹמֶה לְמֶלֶךְ שֶׁנִּשְׁבָּה בְּנוֹ נִלְבַּשׁ בִּלְבוּשׁ נְקָמָה בְּאוֹיְבָיו וְהָלַךְ וְהֵבִיאוֹ, נָטַל אֶת הַשַּׁבַּאי וּתְלָאוֹ בְּגַרְדּוֹן, הִתְחִיל לְצַעֵר אוֹתוֹ וְאָמַר לֵיהּ לָמָּה עָשִׂיתָ כָּךְ לִבְנִי, עִם שֶׁהוּא מְצַעֲרוֹ הִתְחִיל לְהוֹדוֹת וְאָמַר הַמֶּלֶךְ וַוי שֶׁהוֹדָה זֶה, הָיִיתִי מְבַקֵּשׁ לְצַעֲרוֹ הַרְבֵּה וְהוֹדָה, מִיָּד נָתַן לוֹ אֲפִיפוֹרִין, כָּךְ פַּרְעֹה שִׁעְבֵּד אֶת יִשְׂרָאֵל בְּמִצְרַיִם הִתְחִילוּ הַמַּכּוֹת בָּאוֹת עָלָיו, וּכְשֶׁשְּׁלָחָן אָמַר הַקָּדוֹשׁ בָּרוּךְ הוּא, וַוי שֶׁשָּׁלַח פַּרְעֹה, שֶׁנֶּאֱמַר וַיְהִי בְּשַׁלַּח פַּרְעֹה.