A crime can be the action of violating or breaking the law, having the intention of doing so or helping others in the process; in some systems the simple association for organising a crime is punished, even if the fact is not verified and usually for many crimes the attempt too is punished, even if the crime is not completed (in California, e.g., the punishment can be half of that for the crime itself ). Crimes are viewed as offenses against society, and as such are punished by the state. They can be scholastically distinguished, depending on the passive subject of the crime (the victim), or on the offended interest, in crimes against:
Or they can be distinguished depending on the related punishment (then, on the degree of offense that the forbidden behaviour caused), in delicts and violations.
In general, in most western systems, the definition of a crime requires the existing intention of committing it (voluntas necandi) in the author, therefore it is usually not punished when this intention is missing or when the author has not a complete mental sanity or is under a certain age.
In many systems the penal responsibility is personal, and the retroactivity of the penal law is forbidden so that no one can be punished for a fact that the penal law didn't already describe as a crime at the moment in which the crime was committed.
The definition of a crime generally reflects the current attitudes prevalent in a society. For example, possession of drugs was not always a crime, while the Prohibition Era made alcohol illegal.
Matters related to criminal behavior in society are studied in the field of sociology on the sub-field of criminology, and a person who studies this is called a criminologist. The mental state and acuity of criminals is assessed by psychologists, especially in cases wherein the insanity defense is being utilized.
The first civilizations had codes of law, though these codes were not always recorded. The first known written codes were written by the ancient Sumerians, and it was probably their king Ur-Nammu (reigning on Ur in the 21st century BC) the first legislator of which we received a formal system in 32 articles; it has to be recalled that this is not among the eldest laws, since not all the ancient laws are penal rules. In the antiquity, in fact, codes mostly contained both civil and penal rules together. Sumerians however later issued other codes as the one known as "code of Lipit-Istar" (last king of the 3rd dynasty of Ur, Isin - 20th century BC). This code contains some 50 articles and has been reconstructed by the comparison among several sources.
In Babylon the code of Esnunna before, and the code of Hammurabi (one of the richest ones of ancient times) after, were used and reflected society's belief that law was derived from the will of the gods.
Similarly, some codes of conduct of religious origins or reference have been included in penal codes, forbidden behaviours resulting in real crimes in the states ruled by theocracy even in more recent times.
Crimes are divided into categories and subcategories of definition, under which fall many specific crimes. For example, homicide is the subcategory, of the violent crimes, which includes murder, manslaughter, and in some states, self-abortion or "abortion without consent of the female". Arson and theft are examples of property crimes. Each state has its own penal law, which is frequently based on the Model Penal Code. There are also federal statutes, though the defining of federal crimes only became popular in the 1940s and 1950s.
Crimes are generally classified into different degrees of severity, including violations, misdemeanors, and felonies. Violations are punishable by a fine, misdemeanors are punishable by up to a year in a state penitentiary and/ or a fine, and felonies are punishable by a year or more in a state prison and/ or a fine.
Natural law theory thus distinguishes between criminality and illegality, the former being derived from human nature, the latter being derived from the interests of those in power. The two concepts are sometimes expressed with the phrases "malum in se" and "malum prohibitum". This view leads to a seeming paradox, that an act can be illegal that is no crime, while a criminal act could be perfectly legal.