Hammurabi, the king of Babylon, promulgated one of the first written legal codes in history. The code contained 282 laws and established legal precedents on family law, inheritance, debt, trade, and criminal offenses. By codifying the laws, Hammurabi aimed to ensure fairness and social order across Babylonian society. The code reflected Hammurabi's divine authority as king and established Babylon as a major political and cultural power in Mesopotamia during the 18th century BCE.