Ancient Sumer's Code of Ur-Nammu was compiled 2100-2050 BC. It is the earliest known surviving civil code. Three centuries later, the Babylonian king Hammurabi enacted the set of laws named after him.