Score one for former Democratic presidential candidates Sen. Bernie Sanders and Andrew Yang.

A federal appeals court on Tuesday agreed with a lower federal court judge’s ruling that the Democratic presidential primary contest must be included on the ballot when New York holds its primary on June 23.

SANDERS URGES DNC TO STRIP NY OF ITS CONVENTION DELEGATES AFTER SCRAPPING PRESIDENTIAL PRIMARY

The three judges on the 2nd U.S. Circuit Court of Appeals – after hearing arguments last week – agreed with Sanders and Yang that the presidential primary contest should be included.

Yang tweeted immediately following Tuesday’s ruling that he’s “Thrilled that democracy has prevailed for the voters of New York!”

Faiz Shakir, who managed Sanders' 2020 presidential campaign, said in a statement that the "2nd Circuit Court of Appeals today confirmed what we knew: the State of New York acted illegally in trying to cancel the Democratic presidential primary."

The New York State Board of Elections effectively canceled the presidential primary last month when the two Democratic commissioners on the panel voted to strip off the ballot every candidate who wasn’t actively campaigning for president. That left former Vice President Joe Biden as the only contender on the ballot. The move would have effectively given all 274 delegates at stake in the state’s Democratic presidential primary to Biden, since he would be the only candidate remaining on the ballot. The action came a day after Sanders had urged the board to let his name remain on the ballot.

THE LATEST FROM FOX NEWS ON THE 2020 PRESIDENTIAL CAMPAIGN

New York Democratic Party chair Jay Jacobs said canceling the state’s presidential primary would mean a lower expected turnout and a reduced need for polling places amid the coronavirus pandemic. Americans have been urged to practice social distancing, and most people are staying in their homes to prevent the spread of the virus.

“It just makes so much sense given the extraordinary nature of the challenge,” Jacobs said at the time. No other contest is on the ballot in about 20 of the state’s 62 counties on June 23, meaning voters in those counties would have no need to go to the polls on that day.

Sanders, the populist senator from Vermont, suspended his presidential campaign in April and endorsed presumptive nominee Joe Biden a week later.

But Sanders pledged to keep his name on the ballot in all upcoming primaries and caucuses to accumulate as many delegates as possible at this summer’s convention. The more delegates Sanders wins, the more influence he and his supporters will have on the party’s platform and rules, which will be voted on during the convention.

Yang, who dropped out of the presidential race in February, took the state to court after getting booted from the ballot. Yang claimed the move was unconstitutional because he “believed and expected that [his] name would nonetheless stay on the ballot in states with upcoming elections,” and he “hope[d] that voters would express their preferences by voting in the upcoming elections.”

Fox News' Marta Dhanis contributed to this report.