An ex post facto law is a law that retroactively changes the legal consequences of actions that were committed before the law was enacted, often making previously legal actions illegal or increasing penalties for crimes. Such laws are prohibited by the U.S. Constitution to protect individuals from being punished for actions that were lawful at the time they were performed.