An ex post facto law (from the Latin for "from something done afterward") or retroactive law, is a law that retroactively changes the legal consequences of acts committed or the legal status of facts and relationships that existed prior to the enactment of the law. In reference to criminal law, it may criminalize actions that were legal when committed; or to aggravate a crime by bringing it into a more severe category than it was at the time it was committed; or to change or increase the punishment prescribed for a crime, such as by adding new penalties or extending terms; or to alter the rules of evidence in order to make conviction for a crime more likely than it would have been at the time of the action for which a defendant is prosecuted. Conversely, an ex post facto law may decriminalize certain acts or alleviate possible punishments (for example by replacing the death sentence with life-long imprisonment) retroactively.
A law may have an ex post facto effect without being technically ex post facto. For example, when a law repeals a previous law, the repealed legislation no longer applies to the situations it once did, even if such situations arose before the law was repealed. The principle of prohibiting the continued application of these kinds of laws is also known as Nullum crimen, nulla poena sine praevia lege poenali.
Generally speaking, ex post facto laws are seen as a violation of the rule of law as it applies in a free and democratic society. Most common law jurisdictions do not permit retroactive legislation, though some have suggested that judge-made 'law' is retroactive as a new precedent applies to events that occurred prior to the judicial decision. In some nations that follow the Westminster system of government, such as the United Kingdom, ex post facto laws are technically possible as parliamentary supremacy allows the parliament to pass any law it wishes. However, in a nation with an entrenched bill of rights or a written constitution, ex post facto legislation may be prohibited.
Ex post facto is the uncomplimentary characterization of law and legislation that applies retroactively (i.e. "from a thing done afterward").
"The sentiment that ex post facto laws are against natural right, is so strong in the United States, that few, if any, of the State constitutions have failed to proscribe them. The federal constitution indeed interdicts them in criminal cases only; but they are equally unjust in civil as in criminal cases, and the omission of a caution which would have been right, does not justify the doing what is wrong. Nor ought it to be presumed that the legislature meant to use a phrase in an unjustifiable sense, if by rules of construction it can be ever strained to what is just." (Thomas Jefferson, Letter to Isaac McPherson, August 13th, 1813)