NEW YORK (CBSNewYork/AP) — New York City’s Board of Elections has certified Queens Borough President Melinda Katz as the winner in the hotly contested Democratic primary for Queens District Attorney.

Katz defeated Tiffany Caban, a 31-year-old public defender who was backed by progressive Rep. Alexandria Ocasio-Cortez.

READ MORE: FBI Executes Search Warrant At Home Of Gabby Petito's Fiancé Brian Laundrie

Melinda Katz (Credit: CBS2)

Katz’s margin of victory was razor thin – just 60 votes. With all votes counted, the Board of Elections certified her winning with 34,920 votes over Caban’s 34,860.

Caban initially appeared to hold the lead in the race, but the recount resulted in Katz being declared the winner.

“This is a great day for the people of Queens, who have waited patiently for the long recount process to conclude,” Katz said. “While it is everyone’s right to avail themselves of the judicial process, I urge all participants in this hard-fought election to come together and join me in beginning the hard work of reforming the criminal justice system in Queens. This is a major moment for this borough, and it will take the support of all its residents to make this effort a success. I will be spending the months ahead preparing for this critical task.”

Caban had been endorsed by two presidential contenders, Sens. Elizabeth Warren of Massachusetts and Bernie Sanders of Vermont, as well as Ocasio-Cortez, herself. She didn’t have any prior political experience but has spent her career working as a public defender in Queens, where she was born and raised.

Tiffany Caban (Credit: CBS2)

Katz had the backing of state and county party leaders like New York Gov. Andrew Cuomo as well as a host of unions. Katz, a veteran politician, also served in the state Assembly from 1994-99 and on the New York City Council from 2002-09.

READ MORE: Yonkers Police: 2 Men Dead After One Jumps Off Building And Hits The Other 12 Stories Below

Katz was hurt by the fact that there were several candidates in the primary, and one, former Judge Greg Lasak, who ran third, got more than 13,000 votes, siphoning off her support.

There was also the fact that Katz flip-flopped on the issue of cash bail. From the start, Caban supported ending cash bail in all cases, a position she stressed on a CBSN New York special about the race.

“Most folks agree with ending cash bail, expanding alternatives to incarceration. We talk about a real commitment to de-carcerating,” Caban said.

Before she changed her mind, Katz only wanted to end cash bail for misdemeanors and non-violent felonies. Caban pushed her to the left.

“I do support no cash bail,” Katz said, adding, “We need to make sure we are following the laws we have in the state of New York.”

Katz moves on to the November general election against the Republican challenger and the final race to succeed longtime District Attorney Richard Brown, who died last month at age 86.

MORE NEWS: New York City Public Schools To Increase COVID Testing, Relax Quarantine Rules

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)