The stunning upset win Tuesday of an insurgent in a Massachusetts congressional primary – less than three months after another insurrectionist challenger prevailed in New York – signals important strains in the Democratic Party as critical midterm congressional elections approach and as the party girds for the 2020 presidential race against Donald Trump.

This time the winner was Ayanna Pressley, a black Boston city councillor who defeated Representative Michael Capuano, a 20-year veteran of the House of Representatives. Her victory, which had echoes of the triumph of political newcomer Alexandria Ocasio-Cortez over another 20-year veteran, Representative Joe Crowley, in Queens and the Bronx, was a fire bell in the night for establishment Democrats – and a smoke alarm for the White House as it faces the threat of a Democratic Congress and a possible attempt to impeach the President.

“The Pressley victory was a win that speaks to the times,” said Mark Gearan, a former White House deputy chief of staff under Bill Clinton who now is the director of the Institute of Politics at Harvard, which borders the riding where the contest was conducted. "Her message met the hunger Democrats now feel to have a strong and affirmative answer to President Trump.”

Story continues below advertisement

In both races, conducted in deep-blue Democratic states fiercely antagonistic to the President, the theme was generational change, the coming of age of minority candidates and voting blocs, and passionate opposition to Mr. Trump. The usual advantages of incumbency, endorsements from major establishment figures, traditional organizational skills and political experience were nullified in the two races, both conducted in districts so Democratic that there will be no Republican opponent, rendering the twin primaries tantamount to victory in the Nov. 6 midterms.

Like Mr. Crowley, who would have assumed a top leadership post if the Democrats prevail in the House in November, Mr. Capuano had too many establishment credentials, especially in a district with vast demographic changes. Though known as a furious political pugilist, he nonetheless is white, is in his 60s and holds an Ivy League diploma.

“Capuano was a fiery fighter,’’ said former congressman James Shannon of Massachusetts who later served as the state’s attorney-general. "This has to do with cultural changes. There’s a strong feeling we need more women in politics and there’s a feeling in districts like that one that more minorities should be in Congress. And this was about the fact that he was a facing a minority woman and had been in politics for a long time."

Even so, the implications of the contest go far beyond Boston and the cultural changes that are roiling the political waters in a riding once represented by congressman John F. Kennedy and former House speaker Thomas (Tip) O’Neill Jr.

The ascendancy of a new generation of Democrats has the potential of recasting the party’s profile much the way the election of 49 Democrats to formerly Republican seats did in the so-called “Watergate baby” midterm elections of 1974, just after impeachment hearings led to the resignation of Richard Nixon. It produced a political earthquake on Capitol Hill whose tremors lasted a generation.

In this case, a new generation of Democrats in Congress could alter the party’s approach to Mr. Trump, even if the Republicans retain control of Capitol Hill in the midterms – and especially if the Democrats grab control. In either case, the party is likely to be even more aggressive in its opposition to the President, and if the Democrats seize the House, the likelihood of an impeachment effort looms over even the most quotidian proceedings.

And even if the Democrats decide that an impeachment drive would be futile – removing the President from office requires a two-thirds vote of the Senate, which fell short after the impeachments of Andrew Johnson (1868) and Bill Clinton (1998) – newly empowered Democrats would hold committee chairs and would possess the ability to issue subpoenas, a prerogative that would torment Mr. Trump and his associates.

Story continues below advertisement

Just over the horizon is the next presidential election, where the strains that were apparent in the New York and Massachusetts congressional primaries will be even greater.

The Democrats face a difficult but vital choice: In their selection of a choice of presidential nominee, do they move to the centre to win back traditional, conservative-oriented party members, especially blue-collar voters, who defected to Mr. Trump in 2016, and to attract suburban voters, especially women, who are discomfited by Mr. Trump’s personal style and character? Or do they move to the left, in the way Ms. Pressley did in Boston and Ms. Ocasio-Cortez did in New York, in reaction to Mr. Trump’s policies on the environment, taxes and regulation?

Indeed, Senator Bernie Sanders of Vermont remains a popular figure on college campuses and in some Democratic circles, and Senator Elizabeth Warren of Massachusetts shows every sign of preparing for a presidential campaign. Those two, defiant and passionate, define the Democratic left – while establishment figures worry the party could repeat the 1972 landslide defeat of George McGovern if it veers too far leftward.