President Trump drew a torrent of criticism from Democrats on Saturday over a series of Twitter messages aimed at U.S. Rep. Elijah Cummings, D-Md., and the Baltimore district that Cummings represents in Congress.

But just a few years ago, Sen. Bernie Sanders — a candidate seeking the Democratic Party’s 2020 presidential nomination — took his own shots at Baltimore, a struggling Northeast city grappling with high rates of violent crime, drug abuse, poverty and political corruption.

“Anyone who took the walk that we took around this neighborhood would not think you’re in a wealthy nation,” Sanders said during a visit to the city’s West Baltimore section in December 2015, the Baltimore Sun reported. “You would think that you were in a Third World country.”

TRUMP DOUBLES DOWN ON CUMMINGS CRITICISM AS DEMS, BALTIMORE OFFICIALS DEFEND ‘HERO’ REP

The independent U.S. senator from Vermont also referred to Baltimore as “a community in which half of the people don’t have jobs.”

“We’re talking about a community in which there are hundreds of buildings that are uninhabitable,” he added, according to the Sun.

“We’re talking about a community in which there are hundreds of buildings that are uninhabitable.”

— U.S. Sen. Bernie Sanders, I-Vt.

Democratic presidential candidate, Sen. Bernie Sanders, I-Vt., speaks at George Washington University in Washington, July 17, 2019. (Associated Press)

Democratic presidential candidate, Sen. Bernie Sanders, I-Vt., speaks at George Washington University in Washington, July 17, 2019. (Associated Press)

Sanders was visiting the section of Baltimore where a 25-year-old black man named Freddie Gray was arrested earlier that year for allegedly possessing an illegal knife. Gray fell into a coma while in police custody and died a few days later, sparking a national outcry against members of the city’s police department.

But all six police officers who were suspended in connection with the death either had all charges against them dropped, or were acquitted.

ARRESTS ANNOUNCED IN GUNPOINT ROBBERY OF BALTIMORE DEPUTY POLICE COMMISSIONER, WIFE

In 2016, Sanders posted a Twitter message about Baltimore.

“Residents of Baltimore’s poorest boroughs have lifespans shorter than people living under dictatorship in North Korea,” Sanders wrote. “That is a disgrace.”

The bleak portrait Sanders painted back then seems little different from the one Trump presented Saturday, in which the president said the city had become a monument to governmental failures.

In one message, Trump described Cummings’ district as “a disgusting, rat and rodent infested mess.”

“If he spent more time in Baltimore,” the president added, “maybe he could help clean up this very dangerous & filthy place.”

“Where is all this money going?” Trump asked later, referring to federal dollars sent to Baltimore over the years. “How much is stolen? Investigate this corrupt mess immediately!”

CLICK HERE TO GET THE FOX NEWS APP

Prominent Democrats – including House Speaker Nancy Pelosi of California, who was born in Baltimore and whose father was a Baltimore mayor, and presidential candidate Sen. Elizabeth Warren – were quick to defend Cummings and fire back at Trump.

Also on Saturday, Sanders appeared to abandon his past critiques of Baltimore and focus instead on defending Cummings and bashing the president.

“Here’s what’s really going on,” Sanders wrote. “@RepCummings has been busy revealing the failures of the Trump administration and exposing the greed of Trump’s friends in the pharmaceutical industry, and our racist president doesn’t like it.”