There were gasps and applause in the crowded courtroom as the judge announced her decision.