QUEENS — After days of counting paper ballots, Queens Borough President Melinda Katz declared victory in the local Democratic primary for District Attorney on Wednesday night.

Opponent Tiffany Cabán had declared victory on election night. Since that day, thousands of mailed-in ballots were opened and counted. Katz' campaign confirmed she was up by 20 votes.

"We said from the beginning that every vote needs to be counted and that every voter needs to be heard, and now we see clearly why this must always be the case," Katz said. "I am proud to have been chosen as the Democratic nominee for for Queens District Attorney. 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."

A spokeswoman for the Cabán campaign said that "if every valid paper ballot vote is counted, we are confident we will prevail."

"Queens voters are inspired by Tiffany Caban's campaign and her vision for real criminal justice reform," the spokeswoman said.

Queens voters are inspired by @CabanForQueens’ campaign and her vision for real criminal justice reform. If every valid paper ballot vote is counted, we are confident we will prevail. — Monica Klein (@MonicaCKlein) July 4, 2019

She noted that there are 2,500 affidavit ballots the Board of Elections refused to count. Arguments over those ballots will continue Friday.

Cabán was endorsed by two presidential contenders, Sens. Elizabeth Warren of Massachusetts and Bernie Sanders of Vermont.

Katz, the Queens Borough President, is a veteran politician. She served in the state Assembly from 1994 to 1999 and on the City Council from 2002 to 2009.