Amy Kennedy planted a flag Tuesday for her family’s political dynasty along the Jersey Shore, winning a heavily contested Democratic primary against an establishment favorite to advance to a general election race against an ex-Democrat who pledged his loyalty to President Trump rather than vote to impeach him.

Shortly after the polls closed, Kennedy, the wife of former congressman Patrick J. Kennedy (D-R.I.), received a concession call from Brigid Callahan Harrison, a college professor and political commentator who had the support of most local party chairs, according to a senior Kennedy campaign adviser. With 30 percent of the votes in, Kennedy led 55 percent to 32 percent over Harrison, according to the Associated Press, which projected Kennedy as the winner.

“My message to Jeff Van Drew tonight is we have had enough and we demand better,” Kennedy said. “We have had enough division and hate and selfishness. We have had enough of being abandoned and mistreated and forgotten. We have had enough of you and Donald Trump.”

Some Democrats had expressed concern that the two leading candidates have run such a fierce race to the end that it could hurt their chances of unifying for the battle later this year against recent Republican convert Rep. Jeff Van Drew, who spent more than 25 years in local Democratic politics before winning the South Jersey congressional district and helping hand the gavel to House Speaker Nancy Pelosi (D-Calif.).

But Harrison’s most powerful patron, George Norcross, issued an immediate congratulatory note to Kennedy and vowed to work with her to try to defeat Van Drew, his former understudy.

“As I said months ago, I look forward to supporting the Democratic nominee in the general election,” said Norcross, who holds no formal title but has held control over South Jersey Democrats with an iron fist for several decades.

Final results in some races were not expected until later this month; some 6 million voters received mail ballots or applications to request such ballots because of the coronavirus pandemic. Election officials have until July 14 to accept mail ballots postmarked on or before July 7.

The competitive South Jersey primary is part of New Jersey’s increased role as a bulwark in Pelosi’s Democratic majority. Just four years ago, the state’s delegation in the House was evenly divided at six Republicans and six Democrats, with few races drawing much interest from either the Democratic Congressional Campaign Committee or the National Republican Congressional Committee.

But as Trump became the GOP nominee in 2016, and particularly after he won the presidency, New Jersey’s heavily suburban districts made a sharp break against Trump’s brand of Republican politics.

By the time the new House was sworn in on Jan. 3, 2019, 11 Garden State Democrats took the oath, with Rep. Christopher H. Smith the lone New Jersey Republican left standing.

Republicans have made reclaiming ground there a key part of their remote hope of regaining the House majority in the November elections. They landed one of their best recruits, state Sen. Tom Kean Jr., to run against freshman Rep. Tom Malinowski (D) in the north-central New Jersey counties of Somerset, Union and Hunterdon.

The NRCC had given early support to Kate Gibbs, 33, a first-time candidate with moderate GOP establishment backing, to challenge Rep. Andy Kim (D) in a key swing district that stretches from the Delaware River to the Atlantic Ocean.

But Gibbs was trailing David Richter, a construction executive who originally wanted to run as the GOP nominee against Van Drew, until Van Drew switched parties and locked down near universal support with Trump’s endorsement.

Republican hopes have faded a bit in terms of defeating Reps. Josh Gottheimer (D), who won in what was previously conservative territory in 2016, and Mikie Sherrill (D), who was part of the wave of Democratic female candidates with national security backgrounds who epitomized the 2018 midterm elections.

It probably would be a good night for Republicans if, in November, they picked up one or two seats in New Jersey. If Democrats return to an 11-to-1 edge in their House delegation, that probably would signal a long night for the GOP across the nation.

The Van Drew race will be the marquee matchup, in the primary and then the general election.

On his first day in office, he drew immediate concern from liberal activists when he declined to vote for Pelosi as speaker during the biennial roll call vote. In October, he voted against starting an initial inquiry into the impeachment of Trump, prompting Harrison to float a potential insurgent candidacy against him in the Democratic primary.

He then voted in December against both articles of impeachment, connected to Trump’s effort to pressure Ukrainian officials to investigate his leading opponent, Joe Biden, and the next day, Van Drew shook Trump’s hand in the Oval Office and pledged his “undying support” to the leader of his new political party.

At that point, Harrison quickly locked down the support of Norcross, South Jersey’s most influential political figure, and, soon after, six of the eight local Democratic county parties endorsed her.

Kennedy, a former teacher, jumped into the race after the holidays and ran an unusual campaign for someone with such a famous last name — as an anti-establishment insurgent trying to ride the recent energy of grass-roots activists.

She won the backing of Atlantic County Democrats, a key bloc that probably will account for a little more than 40 percent of the primary voting, almost all of which was done through the mail because of the coronavirus pandemic.

Kennedy has leaned heavily on her in-laws’ lineage to round up out-of-state support from influential backers such as Martin Luther King III, whose voice was featured in radio ads in Atlantic City. Her campaign mail literature shows pictures of Kennedys including John F. Kennedy at his presidential inauguration and her late father-in-law, Sen. Edward M. Kennedy (D-Mass.), standing with Barack Obama when Kennedy backed the future president’s campaign in early 2008.

“The unfinished work of social justice,” she told The Washington Post in a late-June interview. “And that’s what I think people are really hungry for right now.”

Kennedy raised more money than Harrison, and in the final weeks of the race, she collected the endorsements of New Jersey Gov. Phil Murphy (D) and House Majority Leader Steny H. Hoyer (D-Md.). Murphy has been engaged in a costly political civil war with Norcross and his top ally, state Senate President Stephen Sweeney, for several years, and this congressional primary was their latest proxy battle.

State officials had said they could not recall Norcross’s operatives losing a primary in this part of New Jersey.

“The Kennedys as outsiders,” Harrison said in a late-June interview, marveling at how the Kennedys played the inside game to ring up so much financial support. “That is how they’re marketing this.”