A federal judge has overturned former Penn State president Graham Spanier‘s child endangerment conviction.

On Tuesday, U.S. Magistrate Judge Karoline Mehalchick of the Middle District of Pennsylvania vacated Spanier’s conviction, finding that it was based on a statute that did not go into effect until six years after the conduct for which he was convicted occurred. The 42-page opinion directed prosecutors to retry Spanier within 90 days.