A primary for Queens district attorney that was already receiving national attention as a proxy for the national fight between different Democratic factions is taking another turn, with a tally of paper ballots reversing the initial results and the close margin forcing an automatic recount. Queens Borough President Melinda Katz now has a 20-vote edge over political newcomer Tiffany Cabán, who had held a 1,090-vote lead with 99 percent of precincts reporting on primary night last week.

Katz is the favorite of the state's Democratic Party establishment. Cabán is a public defender who says the criminal justice system is rigged against the poor and was backed by Rep. Alexandria Ocasio-Cortez. Cabán also received endorsements from 2020 Democratic candidates Elizabeth Warren and Bernie Sanders.

Cabán had declared victory on primary night, while Katz called for every vote to be counted. The updated results reversed those stances as well.

Get Breaking News Delivered to Your Inbox

"I am proud to have been chosen as the Democratic nominee for Queens District Attorney," Katz said in a statement. "We know that these numbers can and will be subject to recount, and there may be legal challenges, but what matters most is the will of Queens voters."

Cabán's supporters said they were confident she would win, and said the tally should include some paper ballots that had been invalidated.

"Queens voters are inspired by Tiffany Cabán's campaign and her vision for real criminal justice reform. If every valid paper ballot vote is counted, we are confident we will prevail," said Cabán campaign spokeswoman Monica Klein.

Cabán has called for increased funding for programs that provide an alternative to mass incarceration, decriminalizing sex work and an end to the "broken windows" policing strategy of tackling low-level crime.

"What we've seen is broken-windows policing and prosecution really be weaponized against our black and brown, low-income and immigrant communities," Cabán told CBSN on Monday. "And it hasn't resulted in increased public safety and what we should be doing is focusing on the root causes of crime -- understanding that widespread destabilization drives crimes, whether it is low-level, non-violent or violent offenses.

Cabán has also called for the closing of New York City's major jail, Rikers Island, but not for the building of any new jails in the boroughs. Rikers is technically part of the Bronx, but is reachable only by bridge and bus from northwestern Queens.

Queens, one of the most diverse counties in the United States, has a population of more than 2.5 million, but just over 85,000 votes were cast on Tuesday. The low turnout may have boosted Cabán, who also received a high amount of outside funding from progressive groups.

The winner will be favored to win the November general election to succeed longtime District Attorney Richard Brown. He died in May at age 86.

Caroline Linton contributed reporting