An ex post facto law is a law that is applied retroactively, meaning it punishes or changes the legal consequences of actions that were committed before the law was enacted. Such laws are generally considered unfair because they make something illegal after it has already been done, and many legal systems, including the U.S. Constitution, prohibit them to protect individuals’ rights.