Mr. Trump’s weekend tweetstorm assailing the congressman — which continued into Monday with an attack on the Rev. Al Sharpton, a civil rights leader who was in Baltimore for a conference on the black economic agenda — reverberated throughout this long-suffering city, whose troubles predated the Freddie Gray uprising. City leaders and residents are furious but not entirely surprised that a president who seems intent on exploiting racial and cultural tensions as a path to re-election in 2020 would train his fire on Baltimore.

On Monday, Gov. Larry Hogan of Maryland belatedly weighed in after absorbing criticism for an initially tepid response to the president’s comments. He called Mr. Trump’s attacks “outrageous and inappropriate,” though Mr. Hogan — a Republican who was once considered a possible primary race challenger to Mr. Trump — avoided going after the president by name. Instead, he issued a broad criticism of the dysfunction of Washington.

City leaders were more pointed.

“No one in Baltimore is surprised that the president is attacking Baltimore,” the City Council president, Brandon M. Scott, said in an interview on Monday morning. “I think that this president is someone who’s trying to get re-elected off us. So he is going to try to rally his base. He’s trying to stoke fears, racial biases — and he is trying to pull the worst out of American society in order to get re-elected.”

Residents were more pointed still.

“Trump is a buffoon. He looks at this as an African-American community, and that’s all he sees. That’s where his narrow mind is,” said John Cheatham, 66, who said he covers murder trials for a local radio station, adding, “If you had a Mount Rushmore of hate, he would be on it.”