Queens Borough President Melinda Katz claimed the fight to become the county's next district attorney ended Thursday after a recount gave her a slender lead in the Democratic primary—but her opponent plans to take the battle to court.

A three-week manual tally of ballots cast in last month's election left Katz, the preferred candidate of the local party establishment, 60 votes ahead of insurgent Tiffany Cabán. Cabán appeared to have won the top prosecutor's job on primary night, but Katz shockingly captured a tiny lead after the Board of Elections tabulated several thousand absentee ballots.

The borough president Friday declared victory for the second time this month.

"Now that every valid vote has been counted and recounted, the results confirm once again that the people of Queens have chosen Melinda Katz as the Democratic nominee for district attorney," her campaign said in a statement.