In the late 7th century BCE Judah became a vassal-kingdom of the Neo-Babylonian Empire; however, there were rival factions at the court in Jerusalem, some supporting loyalty to Babylon, others urging rebellion. In the early years of the 6th century, despite the strong remonstrances of the prophet Jeremiah and others, king Zedekiah revolted against Nebuchadrezzar and entered into an alliance with pharaoh Hophra of Egypt. The revolt failed, and in 597 BCE many Judahites, including the prophet Ezekiel, were exiled to Babylon. A few years later Judah revolted yet again. In 589 Nebuchadnezzar again besieged Jerusalem, and many Jews fled to Moab, Ammon, Edom and other countries to seek refuge. The city fell after an eighteen-month siege and Nebuchadnezzar again pillaged and destroyed Jerusalem and burned the Temple. Thus, by 586 BCE much of Judah was devastated, the royal family, the priesthood, and the scribes—the country's elite—were in exile in Babylon, and much of the population still in neighouring countries. the former kingdom suffered a steep decline of both economy and population.