Queens Borough President Melinda Katz claimed victory Thursday in the county’s hotly contested Democratic district attorney primary fight, after she managed to expand her razor-thin lead during a nearly two-week-long manual recount.

However, left-wing challenger Tiffany Cabán vowed to continue fighting despite Katz building a lead of roughly 60 votes — pointing to the 114 provisionally cast ballots that remain uncounted and are the subject of a coming court fight.

The primary victor will become the heavy favorite to win November’s general election in the increasingly left-leaning borough.

“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,” Katz spokesman Andrew Kirtzman said in a statement. “We wish to thank all of those who continued to believe in her message, and to the many who never gave up faith.”

Cabán struck a defiant tone during a press conference shortly before the Board of Election was expected to complete its unofficial tally of the results.

“This race is not over,” the public defender-turned-progressive insurgent said. “We are going to continue to fight to make sure that every single valid vote is counted.”

However, her attorney, election lawyer Jerry Goldfeder, acknowledged to reporters that Katz’s lead had grown to either 59 or 60 votes.

The back-and-forth came after Board of Election workers in Queens spent nine days recounting all 91,000 ballots cast in the June primary by hand, with the final ballot coming from the Corona neighborhood’s state Assembly district.

That last vote went for Katz — ending a process that helped the longtime pol stretch what was once a razor-thin 16-vote lead to roughly five dozen votes.

It marked nearly a complete reversal of fortune from primary night, when Cabán looked set to score a stunning 1,100-vote upset victory over Katz.

But the public defender’s lead vanished after election workers tallied the 3,400 absentee ballots that went heavily to the longtime Queens pol.

The race may still not be over with the conclusion of the recount.

The race may still not be over with the conclusion of the recount and certification of the election.

Goldfeder said Thursday the Cabán’s campaign plans to go ahead with a court hearing set for August 6 to litigate “hundreds” of votes he argues were improperly excluded from the count.

Previously, the Board of Elections previously said there were 114 votes — largely ballots cast provisionally by voters who failed to properly fill out the paperwork — but Goldfeder claimed the number was far higher, though he wouldn’t reveal a figure.

“I’ll release everything when I give it to the judge,” Goldfeder said.