Hammurabi was the sixth king of Babylon who reigned from 1792 BC to 1750 BC. He extended Babylon's control throughout Mesopotamia through military campaigns. Hammurabi is best known for the Code of Hammurabi, the first written legal code, which established laws to govern Mesopotamian society. The 282 articles dealt with social issues like inheritance, marriage, trade and criminal penalties. Hammurabi also established early medical ethics by legally defining the relationship between doctors and patients, and establishing punishments for medical malpractice.