Progressive public defender Tiffany Cabán conceded Tuesday evening after her campaign’s efforts to challenge the primary election results were dealt a blow in court that left them with no clear path to victory.

Speaking to supporters in Astoria on Tuesday night, Cabán said though she won’t be Queens next district attorney, she successfully pushed other candidates to take more progressive stances on a host of issues.

“We pushed candidates to change their positions on prosecuting marijuana, on crime because of poverty, on mental health issues, on substance use disorder. We pushed candidates to demand that we close Rikers faster and that they do it without building new jails,” she said. “We terrified the Democratic establishment.”

While the Board of Elections had crowned Queens Borough President Melinda Katz the victor by a margin of 60 votes last week after a lengthy manual recount of more than 90,000 ballots, Cabán refused to concede and her campaign challenged the results on certain technical grounds in court.

But their efforts fell flat earlier in the day Tuesday, when State Supreme Court Judge John scrapped 23 affidavit ballots because the voter hadn’t written their party affiliation on the ballot’s envelope.

“I disagree with a number of rulings of the Board of Elections,” said Cabán’s lead attorney Jerry Goldfeder outside the Queens Board of Elections offices earlier Tuesday afternoon, where the Judge had considered the ballots. “I disagree with a number of rulings from the Court. But that’s the process we’re involved in.”

Goldfeder had unsuccessfully tried to persuade Judge Ingram that affidavit ballots without party affiliation marked on the envelope were the fault of poll workers, who should be responsible for making sure a voter was accurately filling out the affidavit and thus those votes should be counted.

“It’s [the poll worker’s] responsibility to make sure the voter has correctly completed all entries on the envelope,” Goldfeder had argued. “That’s not a big burden.”

According to Board or Elections protocol, poll workers are instructed to, “check to see that the voter has correctly completed Affidavit Envelope.”

But while Judge Ingram agreed this was part of poll worker training, he decided it was ultimately the voter’s responsibility for accurately filling out the envelope.

“I’m going to rule that poll workers have no affirmative duty to check, verify and make corrections or suggest corrections to the voter,” Justice Ingram ruled, tossing the 23 contested ballots. “The voter has some responsibility here.”

Judge Ingram’s decision came after hours of tedious deliberation over whether or not several dozen other Election Day ballots would be counted because of errant marks on the ballots, like squiggles, check marks, multiple votes, a lightning-bolt-shaped mark and in one case, a mustard smear.

When all the haggling was over, Cabán eked out five additional votes, shrinking Katz’ lead to 55. The campaign had planned additional challenges for some ballots invalidated for being cast at the wrong polling site and several others that were thrown out because of a voter’s registration status.

But without the two dozen affidavit ballots, Cabán’s camp had no clear way to make up the difference. Cabán spoke with anger about the discounted affidavit ballots in her concession speech, to booing supporters.

“Dozens of unopened ballots sit, because dozens of registered Democrats didn’t write the word Democrat on their affidavit ballots,” she said. “That must change.”

Tuesday’s outcome is the latest twist in more than a month-long saga that began on June 25 with Cabán, who’d garnered endorsements from national progressive leaders including Senator Bernie Sanders and Elizabeth Warren, declaring victory on election night ahead by 1,100 votes. When 6,000 paper ballots were counted Katz pulled ahead by just 16 votes, a slim margin that triggered the manual recount.

After a general election in the fall, Katz, a former city councilwoman and Queens Borough President since 2013, will likely lead the District Attorney’s office in the new year. In a statement Katz thanked Caban for conceding.

“I look forward to pressing ahead with my reform agenda as District Attorney,” Katz said. “I ask all Queens residents, regardless of whom they supported in this race, to join together to make our borough a model for successful, safe reform.”