The Babylonian Empire, located between the Tigris and Euphrates Rivers, and stretched from the present-day city of Baghdad south to the Persian Gulf, occupying the middle and southern part of Mesopotamia, began in 1792 BC, when Babylon was established by the Amorite kings. As the city of Babylon was the capital of the Babylonian Empire for several centuries, the term Babylonia refers to the entire culture that developed in the area from the time it was first settled, around 4000 BC. However, before the emergence of Babylon, Mesopotamia had a long history with Sumerian civilization that flourished between 4100 and 1750 BC, followed by the Akkad, which later ended in 1800 BC, with the rise of Babylonia under King Hammurabi, the sixth Amorite king of the Old Babylonian Empire. He conquered the surrounding city-states and raised Babylon as the capital of his kingdom, reportedly the site of the Hanging Gardens, one of the Seven Wonders of the Ancient World. Hammurabi also forged coalitions between the separate city-states, promoted science and scholarship, and also enforced his famous code of law, which improved the much earlier codes of Sumer, Akkad and Assyria. During his reign, Southern Mesopotamia was named Babylonia and the city of Babylon came to be known as a Holy City, also revered by Assyria for the religious reasons, where the legitimate ruler of southern Mesopotamia had to be ritually crowned. The political importance of Babylon, together with its favourable location, made it the main commercial and administrative centre of Babylonia, while its wealth, status and standing made it a target for the foreign conquerors.
However, after the death of Hammurabi, the Babylonian Empire began to fall apart anf disintegrate rapidly. In 1740 BC, both the Babylonians and the Amorite rulers were driven out of Assyria to the north by an Assyrian-Akkadian governor Puzur-Sin, and Amorite rule survived in a much reduced Babylonia. Shamshu-Ditana, the last Amorite ruler of Babylon, came under pressure from the Kassites, a people originating in the mountains of what is today northwest Iran, after which Babylon was attacked by the Anatolia-based Hittites in 1595 BC. Finally, Shamshu-Ditana was overthrown by the Hittite King Mursilis, when the Hittites removed the images of the gods Marduk, the patron deity of Babylon, and his consort Zarpanitu, from the temple of Ésagila or Esangil. However, instead of annexing Babylon as part of his kingdom, Mursilis made an alliance with the Kassites from the mountains east of Babylonia, and a Kassite dynasty was established in Babylonia by Gandash of Mari, which lasted for 576 years, the longest dynasty in Babylonian history, and renamed Babylon Karduniaš.
Apart from Babylon, other Babylonian cities also flourished during the rule of the Kassite dynasty, which became the centres of great scribal learning and produced writings on divination, astrology, medicine and mathematics, including the Enuma Elish, the Babylonian epic of creation. Karaindaš, one of the prominent rulers of the Kassite dynasty, who reigned towards the end of the 15th century BC, built a bas-relief temple in Uruk, while Kurigalzu I, the 17th king of the dynasty, built a new capital near the confluence of the Tigris and Diyala rivers, and named it Dur-Kurigalzu after himself, transferring administrative rule from Babylon. However, both of them continued to struggle unsuccessfully against the Sealand Dynasty of southern Mesopotamia, which remained independent of Babylonia, while Assyria broke away from Babylonian control and developed as an independent empire, threatening the Kassite dynasty in Babylonia By that time, the Elamites also grew powerful and conquered most of Babylonia, and ultimately, Kutir-Nahhunte II of Elam defeated Enlil-nādin-aḫe, the 36th and final king of the Kassite dynasty, to bring the downfall of the dynasty in 1157 BC.
Following the fall of the Kassite dynasty, Babylonia came under the control of Marduk-kabit-ahheshu, who established the Second Dynasty of Isin, named after the city of Isin, a non-Kassite dynasty, and the first native Akkadian-speaking south Mesopotamian dynasty, to rule Babylon for around 125 years. Nebuchadnezzar I , the fourth and the most famous ruler of the Second Dynasty of Isin, who ruled for 22 years, successfully drove out the Elamites, invaded and sacked the Elamite capital Susa, and recovered the sacred statue of Marduk that had been plundered and carried away from Babylon. In the later years of his reign, Nebuchadnezzar I devoted to building projects, as well as securing Babylonia's borders against the Assyrians, Elamites and Arameans. His construction activities are recorded in inscriptions on the temple of Adad in Babylon and on bricks of the temple of Enlil in Nippur. However, the Babylonian Empire suffered major blows as its power descended into a period of chaos in 1026 BC, when Nebuchadnezzar’s sons lost a series of wars with Assyria, and their successors effectively became subordinates of the Assyrian kings.
After the death of Ashurbanipal, the last ruling Assyrian king, Nabopolassar, a Chaldean leader, made Babylon his capital and instituted the last and the greatest period of Babylonian supremacy. Nabopolassar was succeeded by his son Nebuchadnezzar II, who conquered Syria and Palestine, campaigned against the Egyptians and drove them back over the Sinai, a peninsula in Egypt. He also crushed and deposed Jehoiakim, the king of Judah, destroyed Judah and Jerusalem in 587 BC, and deported a large number of captivated Jews to Babylonia. Apart from that, Nebuchadnezzar II rebuilt the city of Babylon in the sixth century BC, to make it the largest ancient settlement in Mesopotamia, guarded by two sets of fortified walls and decorated with massive palaces and religious buildings, which included the rebuilding of the Temple of Marduk and the restoration and enlargement of the Central Ziggurat in Babylon, which some believe inspired the Biblical story of the Tower of Babel. As a part of a grand walled processional way leading into the city of Babylon, he ordered to construct the eighth gate on the north to the inner city, and named it The Ishtar Gate , dedicated to the Babylonian goddess Ishtar. Although there is no archaeological or documentary evidence, and it is unclear whether the Hanging Gardens were an actual construction or a folk tale, it is said that Nebuchadnezzar II built the Hanging Gardens of Babylon, one of the Seven Wonders of the Ancient World, for the satisfaction of his Median wife, Queen Amytis, who was homesick, missing the lush green hills and valleys of her homeland.
However, Babylonia ceased to be independent, when the Persians, under Cyrus the Great, captured Babylonia in 539 BC, from Nabonidus, the last successor of Nebuchadnezzar. Much later, in 331 BC, Alexander the Great planned to make Babylon the capital of his empire, but after he died in the palace of Nebuchadnezzar, the Seleucids, the Macedonian Greek dynasty that ruled the Seleucid Empire in West Asia, eventually left Babylon, drawing the final curtain to one of the greatest empires in history.