New York Governor Andrew Cuomo won the state’s Democratic gubernatorial nomination, beating actress Cynthia Nixon in an election that tested his ability to counter a progressive challenge in one of the nation’s most liberal states.

Cuomo topped Nixon 66 percent to 34 percent. Nixon conceded the race Thursday night, declaring a victory in the ousting of several Democratic state senators who had aligned themselves with Republicans to thwart the progressive agenda.

Zephyr Teachout, a law professor and anti-corruption activist, finished second in a four-way race for the Democratic nomination for New York attorney general, even after receiving endorsements from the New York Times and other newspapers. Letitia James, the city’s public advocate, won with 41 percent of the vote, while Teachout got 31 percent.

The race for lieutenant governor was closer than the one for the top job. Cuomo’s running mate, incumbent Kathy Hochul, beat Nixon’s partner, black city councilman Jumaane Williams, 53 percent to 47 percent. Cuomo’s victory ran counter to results in several other elections this year in which insurgents defeated incumbents or establishment-backed candidates.