What civilization wrote the first known code of laws?

The first known code of laws was written by the ancient civilization of Babylonia. This code, known as the Code of Hammurabi, was developed by King Hammurabi of Babylon in around 1754 BCE. It consists of 282 laws that cover various aspects of Babylonian society, including family, property, commerce, and criminal justice.