The oldest textual reference to Babylon dates back to the period of Sumer’s archaic dynasties: in ancient Akkadian, the governor of a place called Bar-bar—a phonetic retranscription of Ba(b)bar or Ba(b)bal, probably ancient Babylonian script—was described as the builder of a temple to the god Marduk. Thus around 2500 BC there probably existed a city, populated by Akkadians, that was the capital of a principality. Nothing more is known, because these ancient levels of Babylon are inaccessible to archaeological excavation. The temple in question was probably located on the east, or left, bank of the Euphrates, the site of the current ruins. That is where Neo-Babylonian vestiges of Esagila (the temple of Marduk) were found—the very special location of Esagila and the weight of tradition lead us to think that the first temple of Marduk must have been below it or close by.

The name Babylon appears three hundred years later, on a clay tablet, written in Sumerian ideograms, KÁ.DINGIR.KI, to be read in Akkadian bāb-ilu or bāb-ilim, which means “Gate of (the) God(s).” This document refers to the construction of two temples in Babylon. These twin temples, part of the same complex, were dedicated to two warrior deities, namely Anunîtum, daughter of the moon-god, and the Akkadian god Il-aba: “Year in which Shar-kali-sharri laid the foundations of the temple of Anunîtum and the temple of Il-aba, in Babylon.”
Although still not very abundant, there exists more information about the city one hundred years later, during the 3rd dynasty of Ur (the third Sumerian empire of Ur), between roughly 2100 and 2000 BC. Administrative documents mention Babylon as the seat of a governor of the empire of Ur; civil servants had Akkadian names and belonged to the local aristocracy. The provincial capital of Babylon made offerings to the Sumerian federal temple in Nippur dedicated to the god Enlil, king of gods.

After the fall of Ur, almost all trace of Babylon is lost for one hundred years (2000 to 1890 BC). The political situation in Mesopotamia in the late twentieth century BC was marked by a weakening of the power and political influence of the Isin dynasty. A few chiefs of sedentary Amorite tribes took advantage of the situation by capturing towns in northern Babylonia. The leader of one of these groups, Sumu-la-El, seized possession of Babylon in 1894 BC. It was probably his successor who founded the first Babylonian dynasty around 1880 BC.

The great Akkadian monarchs, Sargon and his grandson Naram-Sin, long served as the model of a heroic king. The depiction of Naram-Sin leading his troops to victory over the people of the Zagros Mountains on his victory stela inspired later all-conquering monarchs when it came to pose and military dress (a short garment with long front panel). Old Babylonian royal victory stelae were influenced by the heroism of the Akkadian empire, while the position of the arms and weapons of the king of Akkad were imitated by the heroic warrior-kings depicted on Old Babylonian seals.

The iconography of the king performing official functions dates back to the Sumerian renaissance of the 3rd dynasty of Ur. Whereas the posture of respect and attentiveness to the deity existed throughout antiquity, the long, draping garment open in the front, leaving the left shoulder uncovered, became mandatory in royal iconography at the end of the third millennium BC. It was worn by Prince Gudea of Lagash (circa 2120 BC), who was a model of the wise, peaceful monarch. The king wore a kind of cap with wide band around the head, set low on his forehead. This costume—long cloak and cap—embodied the perpetuity of the royal function in Mesopotamia.

Other models stem from Sumerian iconography associated with a crucial royal role: the king as builder. Here we see the origin of the motif of the royal insignia of staff and ring that occupy the center of the bas-relief seen at the top of the Code of Hammurabi. Gudea, in the late third millennium BC, held objects crucial to the ceremonial founding of temples, namely a wooden stake and a coiled measuring string. These same tools were given to the king by the god—in imagery that would inspire the carving of the scene at the top of the Code of Hammurabi—on a large limestone stela erected by a king of the 3rd dynasty of Ur. There we see the moon god of Ur, Nanna (Sin), seated on his throne, holding in his left hand a tool—a kind of hoe or adze—used to dig ceremonial foundations. In his right hand, he holds a staff or stake and a coil of looped rope forming a hoop. He hands these tools to the king, recognizable from his head-gear and garment, shown in the act of making an offering. The long beard then became a distinctive sign of royal power. The king Ur-Namma, founder of the 3rd dynasty of Ur—the last Sumerian kingdom—was not only most likely the monarch who dedicated this stela that shows him building the temple and ziggurat of Ur, but was also the author of the oldest known “code” or collection of laws, two hundred years before the famous Code of Hammurabi.

The curved top of a limestone stela, whose stylistic and iconographic details date the carving to the late third or early second millennium BC, features a scene similar to the one found on the stela of Ur-Namma of Ur, which shows the god pouring a libation before a seated god. The plant being watered is a palm tree; the god is probably the sun-god, whose shining disk overlooks the scene. He holds a staff and hoop, but it is no longer a realistic representation of a stake and string but a wand and ring depicted at the top of the code as royal insignia. The ritual of pouring a libation evokes the king’s role of guarantor of the fertility of the land. The overall composition of the scene, similar to the one at the top of the Code of Hammurabi, plus the association of king and sun, suggest that this might be a monument related to the administration of justice, hence an iconographic and perhaps literary model for the stela that later bore Hammurabi’s laws.