An ex post facto law is a law that retroactively changes the legal consequences of actions that were committed, or relationships that existed, before the enactment of the law. In a legal context, ex post facto is most typically used to refer to a criminal statute that punishes actions retroactively, thereby criminalizing conduct that was legal when originally performed. The Latin translation of ex post facto is “from a thing done afterward” .
The United States Constitution prohibits both Congress and the states from passing any ex post facto law. This prohibition applies only to criminal laws and is not a general restriction on retroactive legislation. The policies underlying ex post facto laws are recognized in most developed legal systems, reflected in the civil law maxim "nulla poena sine lege" ("no punishment without law") .
In some nations that follow the Westminster system of government, ex post facto laws may be possible, because the doctrine of parliamentary supremacy allows Parliament to pass any law it wishes, within legal constraints. However, in a nation with an entrenched bill of rights or a written constitution, ex post facto legislation may be prohibited or allowed, and this provision may be general or specific.