Government lawyers spent seven years claiming that a Stanford student belonged on the no-fly list, all the while trying to conceal the bureaucratic error that mistakenly put her there. Right up until the end, the government—knowing what had happened—tried to get her case dismissed.

“He checked the wrong boxes, filling out the form exactly the opposite way from the instructions on the form,” U.S. District Judge William Alsup wrote (.pdf) today.

The decision makes Ibrahim, 48, the first person to successfully challenge placement on a government watch list.

Much of the federal court trial, in which the woman sought only to clear her name, was conducted in secret after U.S. officials repeatedly invoked the state secrets privilege and sought to have the case dismissed.