Code of Ur-Nammu

Translation Fundraiser

In order for students around the world to be able to learn about history for free, we must provide content in many different languages. Donate today and help us translate so that we can make a truly global impact. Thank you!
$906 / $3000


Joshua J. Mark
published on 26 October 2021
Send to Google Classroom:
Law Code of King Ur-Nammu (by Osama Shukir Muhammed Amin, CC BY-NC-SA)
Law Code of King Ur-Nammu
Osama Shukir Muhammed Amin (CC BY-NC-SA)

The Code of Ur-Nammu (c. 2100-2050 BCE) is the oldest extant law code in the world. It was written by the Sumerian king Ur-Nammu (r. 2047-2030 BCE) or his son Shulgi of Ur (r. 2029-1982 BCE) centuries before the famous Code of Hammurabi was inscribed by the Babylonian king Hammurabi (r. 1795-1750 BCE).

The earliest law code from Mesopotamia was the Code of Urukagina (c. 24th century BCE) which survives in the present day only through references in other ancient works. Although the Code of Ur-Nammu is incomplete, enough of it was preserved to allow scholars to understand the king’s vision of law and order in his lands. Presenting himself as the father of his people, Ur-Nammu encouraged his subjects to think of themselves as one family and of his laws as the rules of a home. Punishments, except for capital offenses, took the form of fines in the same way a child might be deprived of a favorite pastime or toy for misbehaving.

Remove Ads


Although the laws were issued under the king's name, it is possible they were actually published by his son, Shulgi, after Ur-Nammu's death. The code was further developed by Shulgi's successors and influenced the form and underlying vision of later codes such as the Laws of Eshnunna (c. 1930 BCE) and the laws decreed under the reign of Lipit-Ishtar (c. 1870 to c. 1860 BCE). These codes, in turn, served as a model for the Code of Hammurabi, which would influence the laws of other civilizations, notably the creation of the Mosaic Law of the Bible.

Rise of Ur-Nammu

Ur-Nammu established the Third Dynasty of Ur in Sumer, also referenced as the Ur III Period & the Sumerian Renaissance.

Mesopotamia was ruled by the Akkadian Empire, established by Sargon of Akkad (r. 2334-2279 BCE), until c. 2083 BCE when a combination of climate change (bringing drought and famine) and an invasion by the West Asian Gutians toppled the Sargonid Dynasty. The Gutians (from the area of modern-day Iran) then presented themselves as the Sargonids' successors but, according to Sumerian accounts, lacked the administrative skills and religious cohesion that had allowed Sargon and his successors to rule so efficiently.

Remove Ads


Even though Sargon's empire had maintained order for centuries, it was never fully embraced by its subjects who periodically revolted only to be put back in their place through military campaigns. The Gutians differed from any other challengers to Sargonid rule, however, not only in that they were able to exploit the empire’s weakness c. 2083 BCE but also because they had nothing in common with the people of Mesopotamia. Scholar Paul Kriwaczek notes:

[According to Sumerian accounts] the Guti were never to be forgiven for being unlike other pretenders to the control of Mesopotamia in having no interest in picking up the baton of civilization and carrying it forward. The chroniclers keep reminding us that these were "unhappy people, unaware of how to revere the gods, ignorant of the right religious practices". It could only be a matter of time before the reviving confidence of the southern cities led to a concerted effort to drive them off. (135)

The moment arrived during the reign of Utu-Hegal of Uruk (c. 2055-2047 BCE) who led a revolt against the Gutians, refused to negotiate with them, and defeated them in at least one major battle. After this victory, he drowned, according to one account, while supervising the construction of a dam. The war with the Gutians, as well as the authority of kingship, then passed to the city of Ur and its governor, Ur-Nammu, Utu-Hegal's son-in-law.

Love History?

Sign up for our free weekly email newsletter!

Donald A. Mackenzie (Public Domain)

Ur-Nammu continued the war with the Gutians and reclaimed major cities, including the great city of Eridu, while also devoting efforts to rebuilding and renovating temples and trade centers damaged in the wars. By taking the kingship, he established the Third Dynasty of Ur in Sumer, also referenced as the Ur III Period (2047-1750 BCE) and the Sumerian Renaissance.

Third Dynasty of Ur

Some modern-day scholars object to the term "Sumerian Renaissance", claiming there had never been a decline requiring a rebirth, but Sumerian accounts maintain that the Gutian period was a time when "grass grew high on the highways of the land" and no grain was grown nor fish caught, and there was no wine or syrup due to mismanagement under Gutian rule (Kriwaczek, 130-135). Ur-Nammu, casting himself as the true successor of the Sargonids, revitalized the land through his policies which included public parks, irrigated orchards and gardens in and around cities, and patronage of the arts. He restored the Sumerian economy or, at least, improved upon it by offering jobs to anyone who wanted or needed one. Scholar Marc van de Mieroop comments:

Remove Ads


Since the state's assets were so enormous, including fields, fishing grounds, manufacturing workshops, and so on, the demand for manpower was very high. The Ur III state was not a totalitarian regime whose inhabitants were fully subjected to the bureaucracy, so labor had to be recruited by offering sufficient compensation. Many of the texts we have record the issuing of rations, which had to be taken from the state's central resources. (79)

These resources seem to have been vast as building projects multiplied and the Sumerian city-states under Ur-Nammu flourished. In order to maintain this prosperity, Ur-Nammu instituted his law code, ensuring everyone understood what was required of them to live peacefully under his reign.

Foundation Figurine of Ur-Nammu
Foundation Figurine of Ur-Nammu
Osama Shukir Muhammed Amin (CC BY-NC-SA)

The Code

He recognized the power of religious beliefs to affect personal behavior and so presented his laws as having been received from the gods. He seems to have made sure people understood the king was only the administrator, not the author, of the code, and when someone broke the law, they were rebelling against the divine will. Kriwaczek comments:

Although it is neither a true law code, being far from comprehensive; nor, some say, even introduced by Ur-Nammu but by his son Shulgi, code or no, although we only have fragments, they are enough to show that the laws covered both civil and criminal matters. Among criminal provisions it specifies which should be capital offences: murder, robbery, deflowering another man's virgin wife, and adultery when committed by a woman. For other misdemeanors the penalty was a fine in silver… [Ur-Nammu's code stands] in contrast to the more famous laws of Hammurabi, drafted some three centuries later, with its savage provisions of "an eye for an eye, a tooth for a tooth". (148-149)

The code was widely publicized during the reign of Shulgi who, as noted, may even have been the actual author. There was no need, however, for a public display of the laws because the people under Ur-Nammu and Shulgi shared a common set of values and traditions, and the laws were intended to encourage proper behavior within already established parameters. Scholar Samuel Noah Kramer describes the code as it appears in columns on a clay tablet in cuneiform script:

Remove Ads


The tablet was divided by the ancient scribe into eight columns, four on the obverse and four on the reverse. Each of the columns contains about forty-five small, ruled spaces, less than half of which are legible. The obverse contains a long prologue which is only partially intelligible because of the numerous breaks in the text. (53)

The prologue details how the moon god Nanna selected Ur-Nammu as King of Ur, helped him defeat the city of Larsa, and provided him with laws under which all subjects were considered equal regardless of social status so that "the orphan did not fall a prey to the wealthy, the widow did not fall a prey to the powerful, the man of one shekel did not fall a prey to the man of sixty shekels" (Kramer, 54). The laws were framed in the conditional sentence pattern of if-this-then-that. A few examples are:

If a man to a man with an instrument…his…the foot has cut off, 10 silver shekels he shall pay.

If a man to a man with a weapon his bones of…severed, 1 silver mina he shall pay.

If a man to a man with a geshpu-instrument the nose has cut off, 2/3 of a silver mina he shall pay. (Kramer, 55)

Remove Ads


The code also specified fines for crimes which, under the later Code of Hammurabi, would be treated far more severely. In Ur-Nammu's code, two offenses in particular are noteworthy:

If a man knocked out the eye of another man, he shall weigh out half a mina of silver.

If a man knocked out a tooth of another man, he shall pay two shekels of silver. (Kriwaczek, 150)

Under Hammurabi’s code, if one knocked out another man’s eye, he paid with one of his own and likewise with a tooth.

Code of Lipit-Ishtar

The Code of Lipit-Ishtar seems to have been created primarily to deal with disputes arising from estate problems, inheritance, & debt enslavement.

There were a number of steps between the Code of Ur-Nammu and that of Hammurabi, however, and good reasons why the fairly benevolent law code of Ur-Nammu had to be changed. The subjects of the Third Dynasty of Ur were, more or less, a homogenous population of Sumerians, but by the time of the last monarch, Ibbi-Sin (r. 1963-1940 BCE), the population was more diverse. This trend continued through the establishment of the Dynasty of Isin by Ishbi-Erra c. 1953/1940. Ishbi-Erra defeated the Amorites and Elamites who had tried to fill the power vacuum after the fall of the Gutians, and some of these people now lived and worked among the Sumerians in greater numbers than before.

During the reign of the fifth king of the Dynasty of Isin, Lipit-Ishtar, a new law code was necessary. One of the major provisions of the Code of Lipit-Ishtar dealt with debt enslavement, which had become widely practiced, whether by people selling themselves into slavery or members of their family. The code also mandated community service for public works and set fair tax rates and estate laws. Although these laws were known and understood by legal assemblies, they were not usually consulted in reaching a verdict, as scholar Gwendolyn Leick explains:

The Mesopotamian justice system relied primarily on customary law that was upheld by the assembly of elders or town official or courts. Judges could be chosen from the local community or be appointed by the king. Affected parties represented their own case and brought witnesses as appropriate. Proceedings, or at least the verdicts, were written down, and numerous tablets have been preserved from most historical periods. In the absence of witnesses, the accused could be referred to an ordeal, such as being thrown into a river or canal. The person's innocence was proved when the "river refused" the culprit. Defendants and plaintiffs were made to swear an oath on the divine emblems, such as the sun disk, which represented the god of justice, Shamash.

As kings were seen as the upholders of law and order, they often issued legal reforms, debt releases, and decrees that were recorded in writing and are often referred to as law codes, although there is no evidence that courts ever referred to such edicts. (105)

Instead, courts relied on traditional methods – such as the ordeal – to establish guilt or innocence and then imposed whatever punishment seemed fit. The Code of Lipit-Ishtar seems to have been created primarily to deal with disputes arising from estate problems, inheritance, and debt enslavement, and while the upper class may have observed the laws strictly as written, villages, towns, and cities seem to have regarded them more as a guideline than a law code, if they even acknowledged them at all.

Hammurabi's Code

Hammurabi came to power after his father, Sin-Muballit (r. 1812-1793 BCE), abdicated in his favor. Sin-Muballit had attacked the wealthy city of Larsa, which was protected by the Dynasty of Isin, and he was defeated, forcing him to step down. Hammurabi may have felt that his father was too hasty in launching the campaign against Larsa and so made a show of seeking peace and busying himself with building projects while he quietly raised and equipped the army that would conquer all of Mesopotamia.

Code of Hammurabi
Code of Hammurabi
Larry Koester (CC BY)

It is unclear when Hammurabi's Code was written, but it seems to have been instituted c. 1772 BCE to establish order in Babylon which would provide a stable home front to launch military campaigns from. Babylon's population was far more diverse than the subjects of Ur-Nammu or Lipit-Ishtar as it was a cosmopolitan intellectual and trade center, drawing people from all over the region and as far away as Egypt and Greece. Hammurabi's Code, therefore, had to present a set of laws that transcended any national legal traditions or understandings people may have arrived with as well as any traditional law practices observed in the various Mesopotamian city-states and kingdoms. Kriwaczek comments:

Hammurabi's laws reflect the shock of an unprecedented social environment: the multi-ethnic, multi-tribal Babylonian world. In earlier Sumerian-Akkadian times, all communities had felt themselves to be joint members of the same family, all equally servants under the eyes of the gods. In such circumstances disputes could be settled by recourse to a collectively accepted value system, where blood was thicker than water, and fair restitution more desirable than revenge. Now, however, when urban citizens commonly rubbed shoulders with nomads following a completely different way of life, when speakers of several west Semitic Amurru languages, as well as others, were thrown together with uncomprehending Akkadians, confrontation must all too easily have spilled over into conflict. (180)

Hammurabi, following the lead of Ur-Nammu, claimed his laws had been handed to him by the god Shamash and had a stele engraved with these laws, topped by an image of Shamash giving them to the king, placed in the city square where anyone who could read would have access to them; those who could not, would have had them read to them. Ignorance of the law was therefore no excuse for breaking it because the laws had been publicly proclaimed and were available for consultation at all times. Unlike the Code of Ur-Nammu, which could assume a general understanding among the populace, Hammurabi's Code had to be more explicit – and severe – and, it seems, his code was consulted by the courts. Leick describes the code and its provisions:

[Hammurabi's Code] represents the first known effort to produce a coherent set of abstract legal precepts for the whole country, incorporating diverse local practices and traditional law. There are several main sections (family law, including subsections on adultery, incest, divorce, and inheritance; property law and restitution; loan and hire agreements; and setting standards on charges and wages). It differentiates fines and punishments according to a person's legal status: free, slave, and a category in between. (106)

Instead of monetary fines, the code relied on the concept of retributive justice (also known as Lex Talionis) defined by the famous dictum of "an eye for an eye and a tooth for a tooth". Although almost certainly modeled on Ur-Nammu's Code, Hammurabi's laws were far more detailed to ensure strict compliance.


The one aspect the two codes had in common, besides the standard conditional formula (if-this-then-that), was the claim that they had been received from the gods. This feature would appear in later law codes such as those of the Assyrians and the Mosaic Law of the Bible. Just as Ur-Nammu credited Shamash with authorship of his code, Moses is depicted as having received his from Yahweh.

The Code of Hammurabi was understood as the oldest law code in the world up until 1947 when the Code of Lipit-Ishtar was discovered and then, in 1948, the tablet of the Code of Ur-Nammu was unearthed in Iraq. This was translated by Kramer in 1952, bringing to light the oldest law code in the world. Kramer comments:

How long will Ur-Nammu retain his place as the world's first lawgiver? Perhaps not for long. There are indications that there were lawgivers in Sumer long before Ur-Nammu was born. Sooner or later, a lucky "digger" will come up with a copy of a law code preceding that of Ur-Nammu by a century or more. (55)

While this may well be true, no other law code predating Ur-Nammu's has been found to date and he continues to be regarded as the first lawgiver. Kramer refers to him as "the first Moses" who, in responding to the needs of his people for order, created the first set of laws that applied to all people equally, regardless of social status or supposed privilege.

Did you like this definition?
Editorial Review This article has been reviewed for accuracy, reliability and adherence to academic standards prior to publication.
Remove Ads



We want people all over the world to learn about history. Help us and translate this definition into another language!

About the Author

Joshua J. Mark
A freelance writer and former part-time Professor of Philosophy at Marist College, New York, Joshua J. Mark has lived in Greece and Germany and traveled through Egypt. He has taught history, writing, literature, and philosophy at the college level.

Support Our
Non-Profit Organization

World History Encyclopedia is a non-profit organization. For only $5 per month you can become a member and support our mission to engage people with cultural heritage and to improve history education worldwide.

Become a Member  

Recommended Books


Cite This Work

APA Style

Mark, J. J. (2021, October 26). Code of Ur-Nammu. World History Encyclopedia. Retrieved from

Chicago Style

Mark, Joshua J.. "Code of Ur-Nammu." World History Encyclopedia. Last modified October 26, 2021.

MLA Style

Mark, Joshua J.. "Code of Ur-Nammu." World History Encyclopedia. World History Encyclopedia, 26 Oct 2021. Web. 27 Nov 2021.