The liberal New York Times editorial board cautioned Democrats against the impulse to "gloat" about the apparent chaos taking place in the Republican primary, as Donald Trump upends the party's leadership and orthodoxy.

The paper said Tuesday night that Trump's status as the front-runner for the GOP presidential nomination should serve as a warning for Democratic "elites" who have become complacent with their support among certain demographic groups.

"Democrats would be foolish to gloat about this GOP mess," said the Times. "The Democratic Party has also been caught by surprise by the anger of middle-class voters it thought it could rely on, even while failing to move meaningful legislation on college affordability, gun control, the minimum wage and better care for veterans."

Trump's popularity caught many longtime Republicans off-guard when he catapulted to the top of national polls while dimissing much of the party's platform, which included an effort to adopt a softer tone on illegal immigration and a push for cuts to federal entitlement programs.

Trump, instead, has pledged to deport the 11 million-plus illegal immigrants within the country and to "strengthen" entitlements, positions that have proven popular among white working-class voters.

On Tuesday, Trump handily won all five states, Connecticut, Delaware, Maryland, Pennsylvania and Rhode Island, that were up to vote.

"The Democratic leadership is also too often captive to its own elites," the Times said in its editorial. "Though they practically invented the ideal of campaign finance reform, Democratic politicians, including Hillary Clinton, now at times seem tone-deaf to public anger while they take vast amounts of money from industries with business before the federal government. The Democratic Party has long considered itself the institutional champion of the poor, unemployed and indebted. Now, for many young voters who flock to Bernie Sanders, that is a falsehood."

The paper said "nobody in Washington should be laughing" at Trump's appeal "because his rise carries a grim lesson for all."