(Bloomberg) -- House Speaker Nancy Pelosi and outspoken progressive Democrat Alexandria Ocasio-Cortez put their political clout to the test in a Massachusetts Democratic primary Tuesday that flips the usual battle lines between the party’s establishment and left wings.

Adding to the drama in Massachusetts, the challenge by Representative Joe Kennedy to incumbent Senator Ed Markey invokes the mystique of a family name long and proudly associated with political power in the state.

Pelosi, herself part of a family political dynasty with deep ties to the Kennedy clan, is endorsing the 39-year-old House lawmaker’s bid to unseat the incumbent senator. Ocasio-Cortez is backing Markey, 74, her partner on the Green New Deal proposal that is central to the progressive agenda.

In a switch from the usual script, Pelosi promoted Kennedy as an exemplar of the party’s new generation of leaders -- typically a battle-cry for progressives -- while Ocasio-Cortez is seeking to keep in office a man who had been in Congress for more than a decade before she was born.

Also in Massachusetts, Pelosi and Ocasio-Cortez are on opposite and more typical sides in a House primary, with the speaker supporting House Ways and Means Chairman Richard Neal, 71, over the progressive favorite, 31-year-old Holyoke Mayor Alex Morse.

The winner of the primary in both cases is all but assured of election in November in the solidly Democratic state.

After announcing he would challenge Markey in September of last year, Kennedy initially led in polls, and some suggested Markey might bow out. But he’s fought back aggressively, and recent polls have Markey with a significant lead.

An Aug. 25-27 Emerson College/WHDH poll of likely Massachusetts voters had the incumbent senator leading Kennedy, 56% to 44%. And Markey was leading Kennedy 51%-41% in an Aug. 23-25 Suffolk University poll of likely voters.

There’s been scant public polling in the western Massachusetts district represented by Neal for the past 32 years. An Aug. 23-24 poll conducted for Jewish Insider put the incumbent ahead with 49% against 40% for Morse.

Democratic strategist Joe Trippi said both contests are hard to predict because votes can break late against incumbents, and expanded vote-by-mail and early voting spurred by the pandemic could affect the election in erratic ways. There also is the impact of heightened interest in the race, particularly among more liberal voters, with national political figures weighing in.

“I don’t think anyone can tell you how either of these races will turn out,” said Trippi, who advised Representative Seth Moulton of Massachusetts in his surprise 2014 Democratic primary win over incumbent John Tierney.

Progressives have ousted three Democratic incumbents in this year’s primaries, including Foreign Affairs Committee Chairman Eliot Engel in New York. But it’s unclear whether that energy is being carried into Tuesday’s primary.

“Massachusetts is not really a throw-the-bums-out state,” said Raymond J. La Raja, a political science professor at the University of Massachusetts in Amherst and associate director of the UMass Poll, which had Markey up by 15 points over Kennedy.

Voters in the Senate primary will be choosing between two candidates with liberal voting records. Markey and Kennedy agree on many policies, including the Green New Deal to combat greenhouse gas emissions, a single-payer health care system and overhauling policing practices in the U.S. In August debates, they argued more about outside spending in the race and the increasingly bitter tone of the contest.

Markey called Kennedy at one debate “a progressive in name only.”

In his advertising, Kennedy accused Markey of forgetting about the working class residents of his home town of Malden and focusing more on Washington than Massachusetts. The grandson of Robert F. Kennedy also has played up the family dynasty, with an ad that featured footage of John F. Kennedy and his late grandfather, who served as U.S. attorney general. He said he has the fight for racial justice “in his blood.”

The contest has divided senior House Democrats. Some committee chairs -- including Carolyn Maloney, the head of the Oversight panel who fended off a progressive challenge in New York’s primary -- are backing Markey, a former colleague who served almost 37 years in the House. Others are lined up behind Kennedy, including House Intelligence Chairman Adam Schiff. The co-leader of the Congressional Progressive Caucus, Representative Mark Pocan, also is backing Kennedy.

Early Warning

In the House primary, Neal had the advantage of advance warning about the dangers of ignoring a primary threat from the left and the lessons from Engel’s defeat in July, as well as Ocasio-Cortez’s 2018 upset of then-House Caucus Chairman Joe Crowley. Closer to home, another progressive, Massachusetts Representative Ayanna Pressley, gained her seat by upsetting an incumbent in 2018. Pressley is unopposed in the Democratic primary this year.

Neal has been traveling through the district to meet with voters and run ads promoting how he’s used his seniority for the good of the area. In addition to the backing of Pelosi and other influential Democrats, he got a cross-party endorsement from the state’s Republican governor, Charlie Baker.

Morse, the openly gay mayor of Holyoke, has drawn heavily from the progressive playbook, criticizing Neal for taking corporate PAC donations and arguing that he would better represent the district in Washington.

In early August, Morse was accused by College Democrats of Massachusetts in a letter of “dangerous and inappropriate” behavior by having “sexual contact” with University of Massachusetts Amherst students. Morse has said the relationships were consensual. During a debate he called the allegations a “backroom coordinated political smear” by Neal supporters. Neal has denied having anything to do with the allegations.

Despite the heavy national interest in the Massachusetts races, local influences and conditions probably will be more important, said Matt Barron, a Massachusetts-based Democratic political consultant.

Party Infighting

“This is good old fashioned Bay State Democrats infighting among themselves,” he said. Markey, Barron said, has secured the aging baby-boomer progressives “who still listen to Carole King and Jackson Browne and live in the leafy suburbs,” and now might have the youth vote as well.

“Kennedy has the white working class and more of the communities of color. But the levels of apathy in African-American and Latino precincts in many of the Commonwealth’s cities, like Springfield, is off the charts,” Barron said. “If Kennedy can’t pull enough minority votes he’ll likely lose.”

©2020 Bloomberg L.P.