Isaiah - Chapter 27
"Yerushalayim!"
On the day that G-d judges, He will slay the two Leviathans, which Rashi says represent Egypt and Assyria. He will also slay the "sea serpent" (the kingdom of Tzur). When Israel is redeemed, they will be like a vineyard of rich wine that G-d waters and guards by day and night. He can have no anger against the nations because Israel also sins. If He were to wage war on other nations it would be inconsistent. (Alternatively, G-d has no anger against Israel.) If the Jews would hold fast to the Torah, G-d could strike the other nations according to strict justice.
The Jews went to Egypt in the time of Jacob and they flourished into a nation there. G-d repaid Pharaoh for the evil they inflicted on the Jews. When Egypt sent the Jews out, G-d repaid them measure for measure. As it was then, it will be now - Israel will be redeemed from their oppressors. They will be forgiven their sins if they tear down their idols and altars. When they do this, an Edomite stronghold will be abandoned and Israel will dwell there. When the merits of Edom run out altogether, they will be utterly destroyed by the weakest. Israel, however, does not recognize their relationship with G-d, so He is not looking out for them.
When G-d redeems Israel, he will gather all those who have been lost and assimilated thanks to the Assyrian exile. A great shofar will sound and those lost in Egypt and Assyria will return, bowing down to G-d at the Temple in Jerusalem. (This last verse is sung as the song "U'vau Ha'ovdim," with its chorus of "Yerushalayim!" repeated many times.)