Criminal law, as opposed to civil law, is the body of law that relates to crime. It might be defined as the body of rules that defines conduct that is not allowed because it is held to threaten, harm or endanger the safety and welfare of people, and that sets out the punishment to be imposed on people who do not obey these laws.
The first civilizations generally did not distinguish between civil law and criminal law. The important elements are mens rea and actus reus. The first written codes of law were designed by the Sumerians. Around 2100-2050 BC Ur-Nammu, the Neo-Sumerian king of Ur, enacted the oldest written legal code whose text has been discovered: the Code of Ur-Nammu although an earlier code of Urukagina of Lagash ( 2380-2360 BC ) is also known to have existed. Another important early code was the Code Hammurabi, which formed the core of Babylonian law. These early legal codes did not separate penal and civil laws. Of the early criminal laws of Ancient Greece only fragments survive, e.g. those of Solon and Draco.