Trump has recently taken aim at the city -- a Democrats' base -- by announcing he will soon have the Environmental Protection Agency (EPA) slap San Francisco with a notice of environmental violations over its homeless population.
"We're going to be giving San Francisco -- they're in total violation -- we're going to be giving them a notice very soon," he told reporters on Sept. 18 aboard Air Force One.
Following Trump's instruction, EPA Administrator Andrew Wheeler sent a letter to California Governor Gavin Newsom on Thursday, in which Wheeler said "piles of human feces" on the streets of San Francisco have contaminated city waters.
In response to Trump's comments, San Francisco Mayor London Breed said: "To be clear, San Francisco has a combined sewer system, one of the best and most effective in the country, that ensures that all debris that flows into storm drains is filtered out at the city's wastewater treatment plants."
"No debris flows out into the bay or the ocean," she added.
Analysts said Trump's battle against San Francisco was one of his recent attacks on major U.S. cities run by Democratic leaders. The president also authorized on Sept. 18 the EPA to revoke California's waiver that allows it to establish its own safer standards for clean air and water.
Analysts say there is a political motive behind Trump's moves.
"California is one of the most liberal states, so Trump sees attacks on San Francisco as a way to show his differences with Democrats," Darrell West, senior fellow of U.S. research group Brookings Institution, told Xinhua.
"Trump complains that San Francisco is a dirty city with many homeless people and implies Democrats are responsible for its condition," West said.
"Nancy Pelosi is based in San Francisco," he said, speaking of the Democratic House speaker. "So any attack on the city is an attack on her as well."
"Trump sees many cities fighting his policies on a range of issues and wants to put them on notice that he plans to fight back," he added.
Christopher Galdieri, assistant professor of U.S. Saint Anselm College, told Xinhua that "this is red meat for his base, and part and parcel of a general effort by Trump and his supporters to depict major metro areas as unlivable areas."
"Throughout his administration, Trump has shown a disdain for the states that didn't support him. It was well into his term before he visited a single state he hadn't carried," Galdieri said.
"California has been a particular thorn in his side. And this ... is best viewed as him using the powers of office to punish those who didn't support him in 2016 and are unlikely to in 2020," he said.
The number of homeless people in San Francisco has increased in recent years, which has worsened the problem of human waste on the streets. A 2019 report said some 8,000 people were experiencing homelessness in the city in January, up 17 percent from 2017.
Besides, the city has become more tolerant of casual drug use as it legalized marijuana for recreational purposes in 2016. In some areas, homeless drug addicts drop used needles all over the streets, causing a major public health risk.
To deal with the problems, the city has set up public toilets and last year formed a six-person unit to clean up the human waste. It has also announced funding to hire individuals to pick up used needles from the sidewalks and streets, according to local media.