Ed Markey Holds Off Joseph Kennedy in Mass. Senate Race

Now, a number of House lawmakers are bracing for demands that they push through an ambitious agenda in a Democratic-controlled Washington or face another wave of primaries. Some of them may retire or, should Joseph R. Biden Jr. win the presidency, accept administration posts rather than seek re-election.

Yet others will surely seek to mimic Mr. Markey, who succeeded by channeling the new activism on the left. First elected to the House in 1976, he has been a fairly reliable liberal vote in the House and the Senate, where he moved in 2013 after John F. Kerry became secretary of state.

Mr. Markey was never known as a progressive warrior and he has cast a handful of votes — including for the 1990s crime bill and the Iraq war — that are out of step with today’s movement to the left.

He has taken a leadership role on issues related to the environment and technology, however, and that linked him to perhaps his most important supporter: Ms. Ocasio-Cortez. Their joint authorship of the Green New Deal offered Mr. Markey access not only to her endorsement but also entree to a new generation of environmental activists. He captured the early support of the Sunrise Movement, the environmental activist group, and built a strong coalition among young progressives.

“If we’re going to have a planet for people in my generation to live on, we need someone like Senator Markey,” said Lindsay Aldworth, 29, who was active with the Sunrise Movement in college and attended a rally for Mr. Markey in New Bedford, Mass., last week.

That enthusiasm frustrated Mr. Kennedy, who was counting on winning votes from young voters. He believes that the state’s many white liberal voters did not hold Mr. Markey to account for some of his previous stances, including his long-ago opposition to the integration of Boston’s public schools, as they did Mr. Biden.

Mr. Kennedy, however, had built his own coalition of support, winning endorsements from a number of voters of color and working-class people across racial lines.