Ex post facto - "after the fact." An ex post facto law is one which makes a particular act illegal, and punishes people who committed that crime before the law was passed, i.e., when the act was legal. "Ex post facto" means "from a thing done afterward" in Latin.
.