A federal judge on Tuesday agreed with the request of the U.S. Justice Department to dismiss the prosecution of Michael Flynn, formally ending a three-year legal saga in which the former Trump national security adviser twice admitted to lying to the FBI, only to later seek to withdraw his guilty plea and receive a pardon from President Donald Trump.

Citing what Trump termed a “full pardon,” U.S. District Judge Emmet Sullivan brought an end not only to the prosecution but his monthslong review of the Justice Department’s decision, in May, to abandon the case. Sullivan’s reluctance to immediately grant the Justice Department’s bid to dismiss the case drew a challenge from Flynn, pitting the former national security adviser against his trial judge in litigation that raised novel questions about the judiciary’s authority to review—or even deny—decisions to drop prosecutions.