Governor Andrew Cuomo of New York has beaten a leftwing challenge from Cynthia Nixon in the Democratic primaryto win the nomination for a third term.

Nixon, an actor and activist known for her role on Sex and the City, sought to join the wave of insurgent progressives who have pulled off upsets in Democratic races, but in the end came up short in the contest on Thursday.

With 93% of precincts reporting, Cuomo had 65% of the vote to Nixon’s 35%.

“This race for the Democratic nomination may be over, but the fight for the soul of the Democratic party is just beginning,” Nixon told supporters at Cafe Omar in Flatbush, Brooklyn, after calling Cuomo to concede.

Nixon hammered Cuomo as a “corrupt corporate Democrat” throughout the campaign and went after him over New York’s crumbling mass transit system, which the governor controls.

But Cuomo, the son of the former New York Democratic governor Mario Cuomo, far outraised his opponent and highlighted her lack of experience. Nixon has never held political office and chose the state’s top job for her first run.

He pointed, too, to his accomplishments, including raising the minimum wage, passing gun control laws and legalising same-sex marriage.

Cuomo lay low for his election night victory, and did not appear at a party held by his supporters in Manhattan.

Nixon said the result was “not what we had hoped for”, but said she was “not discouraged”.

Gubernatorial candidate Cynthia Nixon delivers her concession speech at the Working Families party primary night party. Photograph: Jason DeCrow/AP

“In our campaign, we took on one of the most powerful governors in America, and it wasn’t easy,” she said. “We started with nothing, and we earned every single vote.”

The race appeared to push Cuomo to the left on several issues: his administration moved toward legalizing recreational marijuana, and he signed an order allowing paroled felons to vote.

Cuomo also made Donald Trump a central figure in the campaign – portraying himself as the best person to stand up to the president. It did not always go smoothly: Cuomo drew fire for saying America “was never that great”, in a fumbled attack on the president’s slogan.

Nixon went further, pushing for single-payer healthcare, driver’s licences for undocumented immigrants, higher taxes on the rich, and a huge boost in education spending.

The race took on a sometimes bitter tone. At their only debate, as the two sparred over the deterioration of New York’s subways under the governor’s tenure, Cuomo barked: “Can you stop interrupting?” at Nixon, who snapped back: “Can you stop lying?”

The contest even featured duelling last-minute endorsements from the feuding rappers Nicki Minaj and Cardi B. After Minaj endorsed Cuomo and his slate, Cardi B threw her support behind Nixon in an Instagram post.

Nixon gained endorsements from leftist groups, and joined a slate of fellow progressives including city councilman Jumaane Williams, who challenged Cuomo’s lieutenant governor, Kathy Hochul, and law professor Zephyr Teachout, who ran for attorney general. None of the three, who gathered for what they hoped would be a victory celebration in Brooklyn, pulled off a victory.

Hochul squeaked out a closer victory over Williams, taking 53% of the vote.

Public advocate Letitia James, who was backed by Cuomo, won a four-way contest for attorney general. The wide-open race began when Eric Schneiderman resigned from the job over allegations he violently abused women – allegations that he denies – and remained close throughout. James would be the state’s first black attorney general.

Progressive insurgents did triumph in a series of local races, against a group of state senate Democrats who had allied with Republicans and handed them control of the chamber. The group’s leader, Jeff Klein, was defeated by challenger Alessandra Biaggi.

Other incumbents who were part of the group, dubbed the Independent Democratic Conference, lost or were trailing on Thursday night. Challengers John Liu, Jessica Ramos, Zellnor Myrie, and Robert Jackson were declared the winners against senators Tony Avella, Jose Peralta, Jesse Hamilton, and Marisol Alcantara.

Julia Salazar, a democratic socialist who drew attention for her activist run and for a series of misstatements she was caught making about her background, also won her race, defeating incumbent Brooklyn senator Martin Dilan.

Thursday’s balloting was marked by complaints from a number of voters that they showed up at their polling places only to be told they were not on the rolls, even though they had registered.

In November’s general election, Cuomo will face Republican Marc Molinaro, the Dutchess county executive, and Stephanie Miner, the former Syracuse mayor running as an independent.

Nixon may still appear on the general election ballot, as the nominee of the liberal Working Families party, unless a manoeuvre is made to remove her from the ballot.

Cuomo had been considered a potential 2020 presidential contender, but ruled himself out as a candidate during the re-election campaign. At his debate with Nixon, he said he would serve a full term as governor unless “God strikes me dead”.