NEW YORK — New York's Democratic presidential primary will take place next month after a federal appeals panel Tuesday upheld the ruling of a judge who determined that scrapping it violated the constitutional rights of former candidates Andrew Yang and Bernie Sanders.

Citing concerns about the coronavirus pandemic, Democratic commissioners on the state elections board had opted to effectively cancel the primary, concluding that the Democratic presidential race was settled because other candidates besides Joe Biden had suspended their campaigns and endorsed the former vice president.

The move prompted a protest from Sanders, an independent senator from Vermont, who said when he suspended his campaign he intended to remain on ballots in upcoming contests to continue to accumulate delegates to the national convention. Yang, a business entrepreneur, was among the plaintiffs in a lawsuit that sought to restore the June 23 primary.

On Tuesday, the three-judge appeals panel affirmed the May 5 ruling of U.S. District Judge Analisa Torres that the plaintiffs “had made a strong showing of irreparable harm.” The panel said an opinion explaining its reasoning would be released later.

“Thrilled that democracy has prevailed for the voters of New York!” Yang said in a tweet responding to the ruling.

In a statement, Sanders campaign manager Faiz Shakir thanked Yang for “standing up to this abuse of power.”

“With today’s decision . . . we expect New York to work to make voting safe, rather than wasting taxpayer money trying to disenfranchise New York voters,” Shakir said.

Doug Kellner, the Democratic co-chairman of the state elections board, said Tuesday that the board will not appeal Tuesday’s ruling to the U.S. Supreme Court, clearing the way for the June 23 Democratic primary to proceed.

“There’s a huge amount of work that needs to be done at the Board of Elections in order to manage the primary election, and we’re going to focus our attention on doing just that,” Kellner told the Albany Times Union.

In late April, the board voted to remove Sanders, Yang and other candidates from the ballot, leaving only Biden. Because New York does not hold uncontested primaries, the decision had the effect of scuttling the vote. Typically, all qualified candidates remain on the ballot regardless of whether they have bowed out and stopped campaigning.

At the time, Kellner said because the nomination was effectively settled, a primary would serve only as a “beauty contest” that could put additional voters and poll workers at risk.

Election officials maintained that canceling the primary would result in significantly fewer Democrats voting on June 23 and said that some upstate counties wouldn’t need to conduct elections at all that day.

New York originally scheduled its Democratic presidential primary for April 28 and primaries for congressional, state and local offices for June 23. New York Gov. Andrew M. Cuomo (D) moved the presidential primary to June 23 in response to the coronavirus outbreak.

Yang’s side said that the state could hold the election without increasing danger to the public by only using mail-in ballots or by making other accommodations, and that the state had an obligation to do so.

New York was the only state to have canceled the presidential primary altogether.

In a hearing last week, the state’s lawyer, Judith Vale, said there would be no harm in the unusual action taken by New York.

“All of these candidates except for one have not only suspended their campaigns but also have affirmatively endorsed the remaining candidate,” Vale argued to a panel of three federal appellate court judges.

Questions by the judges suggested they were critical of the idea that there was no point to holding the election.

Attorney Jeffrey Kurzon, who represented Yang in the lawsuit, argued that the primary, even uncontested, serves an important democratic function. The election of delegates tied to former presidential hopefuls is part of the process that plays out at the party’s convention.

“This is how the game is played,” Kurzon argued. “If you’re not going to be president, then you want to campaign for the person who is going to be president to reflect your beliefs.”

Kurzon said in a statement Tuesday after the ruling that Yang “sued as it was apparent that voters in New York were being stripped of their rights” and because it “simply was not fair for hundreds of people to do thousands upon thousands of hours of work to get him and his delegates on the ballot” only to have their efforts nullified.

Voters “should be able to vote safely from home by absentee ballot” and others who vote in person “can wear masks and take precautions,” the attorney added.

Wagner reported from Washington.