A Manhattan federal court late Tuesday reinstated New York’s June 23 Democratic primary, ruling that the decision to scrap the already-delayed contest amid the COVID-19 pandemic had violated the rights of candidates and their pledged delegates.

The decision, by U.S. District Judge Analisa Torres of the Southern District of New York, came as a win for former presidential candidate Andrew Yang, who suspended his presidential campaign in February after he said it became clear that he no longer had a viable path to winning the party’s nomination.