Ex post facto (Latin for "from a thing done afterward") is a legal term typically used to refer to a law that applies itself retroactively, effectively causing something that was legal when performed to be illegal.

Ex post facto laws are prohibited in the Article I, Sections 9 and 10 of the United States Constitution. Over the years, when deciding ex post facto cases, the United States Supreme Court has referred repeatedly to its ruling in the Calder v. Bull case of 1798, in which Justice Chase established four categories of unconstitutional ex post facto laws.

See: Sonny Bono Copyright Term Extension Act