According to a Babylonian date list, Amorite rule in Babylon began (c. 19th or 18th century BC) with a chieftain named Sumu-abum, who declared independence from the neighboring city-state of Kazallu.

Sumu-la-El, whose dates may be concurrent with those of Sumu-abum, is usually given as the progenitor of the First Babylonian dynasty.

Hammurabi (r. 1792–1750 BC) is famous for codifying the laws of Babylonia into the Code of Hammurabi. He conquered all of the cities and city-states of southern Mesopotamia, including Isin, Larsa, Ur, Uruk, Nippur, Lagash, Eridu, Kish, Adab, Eshnunna, Akshak, Akkad, Shuruppak, Bad-tibira, Sippar, and Girsu, coalescing them into one kingdom, ruled from Babylon. Hammurabi also invaded and conquered Elam to the east, and the kingdoms of Mari and Ebla to the northwest.

The Code of Hammurabi is a well-preserved Babylonian code of law of ancient Mesopotamia, dated to about 1754 BC (Middle Chronology). It is one of the oldest deciphered writings of significant length in the world. The sixth Babylonian king, Hammurabi, enacted the code. A partial copy exists on a 2.25-meter-tall (7.4 ft) stone stele. It consists of 282 laws, with scaled punishments, adjusting "an eye for an eye, a tooth for a tooth" (lex talionis) as graded based on social stratification depending on social status and gender, of slave versus free, man versus woman.

After the reign of Hammurabi, the whole of southern Mesopotamia came to be known as Babylonia, whereas the north had already coalesced centuries before into Assyria. From this time, Babylon supplanted Nippur and Eridu as the major religious centers of southern Mesopotamia. Hammurabi's empire destabilized after his death. Assyrians defeated and drove out the Babylonians and Amorites. The far south of Mesopotamia broke away, forming the native Sealand Dynasty, and the Elamites appropriated territory in eastern Mesopotamia. The Amorite dynasty remained in power in Babylon, which again became a small city-state.

In 1595 BC the city was overthrown by the Hittite Empire from Asia Minor. Thereafter, Kassites from the Zagros Mountains of northwestern Ancient Iran captured Babylon, ushering in a dynasty that lasted for 435 years, until 1160 BC. The city was renamed Karanduniash during this period.

Kassite Babylon eventually became subject to the Middle Assyrian Empire (1365–1053 BC) to the north, and Elam to the east, with both powers vying for control of the city. The Assyrian king Tukulti-Ninurta I took the throne of Babylon in 1235 BC.

By 1155 BC, after continued attacks and annexing of territory by the Assyrians and Elamites, the Kassites were deposed in Babylon. An Akkadian south Mesopotamian dynasty then ruled for the first time. However, Babylon remained weak and subject to domination by Assyria.

During the rule of the Neo-Assyrian Empire (911–609 BC), Babylon was under constant Assyrian domination or direct control.

In the year 878 B.C. Assyria Ashurnasirpal II, king of Assyria, conquered Suro, the main fortress of the governor of Suhum, of the Babylonian state.

During the reign of Sennacherib of Assyria, Babylon was in a constant state of revolt, led by a chieftain named Merodach-Baladan, in alliance with the Elamites, and suppressed only by the complete destruction of the city of Babylon.

In 689 BC, its walls, temples, and palaces were razed, and the rubble was thrown into the Arakhtu, the sea bordering the earlier Babylon on the south. Destruction of the religious center shocked many, and the subsequent murder of Sennacherib by two of his own sons while praying to the god Nisroch was considered an act of atonement.

Consequently, Sennacherib's successor Esarhaddon hastened to rebuild the old city and make it his residence during part of the year.

After Esarhaddon's death, Babylon was governed by his elder son, the Assyrian prince Shamash-shum-ukin, who eventually started a civil war in 652 BC against his own brother, Ashurbanipal, who ruled in Nineveh. Shamash-shum-ukin enlisted the help of other peoples against to Assyria, including Elam, Persia, Chaldeans, and Suteans of southern Mesopotamia, and the Canaanites and Arabs dwelling in the deserts south of Mesopotamia.

Once again, Babylon was besieged by the Assyrians, starved into surrender, and its allies were defeated. Ashurbanipal celebrated a "service of reconciliation", but did not venture to "take the hands" of Bel. An Assyrian governor named Kandalanu was appointed as ruler of the city. Ashurbanipal did collect texts from Babylon for inclusion in his extensive library at Nineveh.

After the death of Ashurbanipal, the Assyrian empire destabilized due to a series of internal civil wars throughout the reigns of Assyrian kings Ashur-etil-ilani, Sin-shumu-lishir and Sinsharishkun.

In November of 626 BC, Nabopolassar was formally crowned as King of Babylon, restoring Babylon as an independent kingdom after more than a century of direct Assyrian rule.

Early in the reign of the Neo-Assyrian king Sinsharishkun, the southern general Nabopolassar used ongoing political instability in Assyria, caused by an earlier brief civil war between Sinsharishkun and the general Sin-shumu-lishir, to revolt. In 626 BC, Nabopolassar assaulted and successfully seized the cities of Babylon and Nippur.

With only small successes during campaigns in northern Babylonia from 625–623 BC and more southern cities, such as Der, joining Nabopolassar, Sinsharishkun led a massive counterattack in 623 BC. Though this counterattack was initially successful and Sinsharishkun might have been ultimately victorious, he had to abandon the campaign due to a revolt in Assyria threatening his position as king.

In October or November 615 BC, the Medes, also ancient enemies of Assyria, under King Cyaxares entered Assyria and conquered the region around the city Arrapha.

In July or August of 614 BC, the Medes began attacking the cities of Kalhu and Nineveh. They then besieged Assur, the ancient political (and still religious) heart of Assyria. The siege was successful and the city endured a brutal sack.

Nabopolassar only arrived at Assur after the plunder had already begun and met with Cyaxares, allying with him and signing an anti-Assyrian pact.

In April or May 612 BC, at the start of Nabopolassar's fourteenth year as king of Babylon, the combined Medo-Babylonian army marched on Nineveh. From June to August of that year, they besieged the Assyrian capital and in August the walls were breached, leading to another lengthy and brutal sack during which Sinsharishkun is assumed to have died.

Sinsharishkun's successor Ashur-uballit II, the final king of Assyria, was defeated at Harran in 609 BC.

Nabopolassar died in 605 BC and was succeeded as king by his son, Nebuchadnezzar II.

Egypt, Assyria's ally, continued the war against Babylon for a few years before being decisively defeated by Nabopolassar's crown prince Nebuchadnezzar at Carchemish in 605 BC.

The Battle of Hamath, sometimes called the Battle of Hama, was a battle between the Babylonians and the fleeing remnants of the Egyptian army defeated at Carchemish. It was fought near the ancient city Hamath on the Orontes.

In addition to his military exploits, Nebuchadnezzar was also a great builder, famous for his monuments and building works throughout Mesopotamia (such as Babylon's Ishtar Gate and the city's Processional Street). In total, he is known to have completely renovated at least thirteen cities but he spent most of his time and resources on the capital, Babylon. By 600 BC, Babylon was seen by the Babylonians and possibly by their subject peoples as being the literal and figurative center of the world. Nebuchadnezzar widened the city's Processional Street and fitted it with new decorations, making the annual New Year's Festival, celebrated in honor of the city's patron deity Marduk, more spectacular than ever before.

Hanging Gardens of Babylon were one of the Seven Wonders of the Ancient World listed by Hellenic culture. They were described as a remarkable feat of engineering with an ascending series of tiered gardens containing a wide variety of trees, shrubs, and vines, resembling a large green mountain constructed of mud bricks. It was said to have been built in the ancient city of Babylon.

Although Nebuchadnezzar is famously portrayed unflatteringly in the Bible, owing to his destruction of Jerusalem in 587 BC, Nebuchadnezzar's 43-year reign would bring with it a golden age for Babylon, which was to become the most powerful kingdom in the Middle East.

The Ishtar Gate was the eighth gate to the inner city of Babylon (in the area of present-day Hillah, Babil Governorate, Iraq). It was constructed in about 575 BCE by the order of King Nebuchadnezzar II on the north side of the city.

After the long reign of Nebuchadnezzar II, the empire fell into a period of political turmoil and instability. Nebuchadnezzar's son and successor, Amel-Marduk.

Amel-Marduk reigned for only two years before being assassinated in a coup by the influential courtier Neriglissar.

Neriglissar was a simmagir, a governor of one of the eastern provinces, and had been present during several of Nebuchadnezzar's campaigns. Importantly, Neriglissar was also married to one of Nebuchadnezzar's daughters and he was as such linked to the royal family. Possibly due to old age, Neriglissar's reign would also be short with some of the few recorded activities being the restoration of some monuments in Babylon and a campaign in Cilicia. Neriglissar died in 556 BC. Neriglissar was succeeded by his underage son, Labashi-Marduk (also the grandson of Nebuchadnezzar II through his mother). Labashi-Marduk's reign was even briefer, being assassinated in the same year after reigning for just nine months.

The perpetrators of the assassination (Labashi-Marduk), the influential courtier Nabonidus and his son Belshazzar, then took power. Despite the turmoil that had surrounded his rise to the throne, the empire itself had remained relatively calm through the difficult period, but there was significant opposition to Nabonidus, who began his reign with the traditional activities associated with the king; renovating buildings and monuments, worshipping the gods and waging war (also campaigning in Cilicia). Nabonidus wasn't of Babylonian ancestry, but rather originated from Harran in former Assyria, one of the main places of worship of the god Sîn (associated with the moon). The new king very openly elevated Sîn's status in the empire, dedicating more attention to this god than to Babylon's national god Marduk. As such, Nabonidus was hated by the Babylonian clergy. This hatred was increased when Nabonidus increased governmental control over the temples in an attempt to solve ongoing management problems with the empire's religious institutions.

Nabonidus left Babylon to campaign in the Levant and then settled for ten years in the city Tayma (which he had conquered during the campaign) in Arabia, another site for the worship of the moon. His son Belshazzar was left to govern Babylonia (though with the title crown prince rather than king, a title Nabonidus continued to hold). Why Nabonidus spent a decade away from his capital there is unknown, though it might have been out of fear either of Babylon's political and religious officials who resented this city representing another prominent place for worship of the moon or due to Belshazzar's increasing influence at court.

In 549 BC Cyrus the Great, the Achaemenid king of Persia, revolted against his suzerain Astyages, king of Media, at Ecbatana. Astyages' army betrayed him and Cyrus established himself as ruler of all the Iranic peoples, as well as the pre-Iranian Elamites and Gutians, ending the Median Empire and establishing the Achaemenid Empire.

Nabonidus return c. 543 BC was accompanied by a reorganization of his court and the removal of some of its more influential members.

Nabonidus fled to Borsippa, and on 12 October, after Cyrus' engineers had diverted the waters of the Euphrates, the soldiers of Cyrus entered Babylon without the need for a battle. Nabonidus surrendered and was deported. Gutian guards were placed at the gates of the great temple of Marduk, where the services continued without interruption.

Cyrus invaded Babylon. Nabonidus sent his son Belshazzar to head off the huge Persian army but the Babylonian forces were overwhelmed at the Battle of Opis.

The early Achaemenid rulers had great respect for Babylonia, regarding the region as a separate entity or kingdom united with their own kingdom in something akin to a personal union. The region was a major economic asset and provided as much as a third of the entire Achaemenid Empire's tribute. Despite Achaemenid attention and the recognition of the Achaemenid rulers as Kings of Babylon, Babylonia resented the Achaemenids, like the Assyrians had been resented a century prior. At least five rebels proclaimed themselves King of Babylon and revolted during the time of Achaemenid rule in attempts at restoring native rule; Nebuchadnezzar III (522 BC), Nebuchadnezzar IV (521–520 BC), Bel-shimanni (484 BC), Shamash-eriba (482–481 BC) and Nidin-Bel (336 BC).