President Donald Trump on Wednesday threatened to have the Environmental Protection Agency issue a "notice" to San Francisco over the city's homeless issue, comments that were criticized by local officials.

From Air Force One, Trump, who had been in California for a two-day fundraising trip, blamed the homeless population for environmental issues. "There's tremendous pollution being put into the ocean," he said, noting "there are needles, there are other things."

"We're going to be giving San Francisco — they're in total violation — we’re going to be giving them the notice very soon," Trump said.

"The EPA is going to be putting out a notice and you know they're in serious violation and this is environmental, very environmental," Trump said. "And they have to clean it up. We can’t have our cities going to hell."

In January, San Francisco found that under the federal Department of Housing and Urban Development definition, around 8,000 people were experiencing homelessness. That was a 17 percent increase over the 2017 "point-in-time" count, according to a 2019 homeless count and survey report. But the city and county of San Francisco uses an expanded definition, under which the homeless population is around 9,700, the report said.

The city has long struggled with problems of human waste and needles on the streets in the Tenderloin district, where many addicts and homeless people are found. The city set up public toilets and last year announced formation of a special six-person "poop patrol" team to clean up the human waste.

The city also announced funding to hire people to pick up used needles, the Associated Press reported. The city's health department hands out an estimated 400,000 clean syringes a month under programs designed to reduce the risk of infections like HIV that can be transmitted to people who share needles, the news service reported.

San Francisco Mayor London Breed seemed to bristle at the president’s comments Wednesday evening. She tweeted: "If the President wants to talk about homelessness, we are committed to working on actual solutions.” She cited plans to add 1,000 shelter beds and said the city is working to pass a $600 million affordable housing bond to create badly needed housing.

"In San Francisco, we are focused on advancing solutions to meet the challenges on our streets, not throwing off ridiculous assertions as we board an airplane to leave the state," the mayor said, according to NBC Bay Area.

Trump’s comments on homelessness in San Francisco and Los Angeles — there are almost 59,000 sheltered and unsheltered homeless people in Los Angeles County, according to a 2019 count — come as he has escalated feuds with the Golden State.

On Wednesday, the president announced that he would revoke the state's waiver that allows it to set its own vehicle emissions standards, which the state’s attorney general and governor have vowed to fight in court.

Earlier this week Gov. Gavin Newsom in a letter signed by state and city officials called on the Trump administration to provide 50,000 more vouchers for rental subsidies and to increase the value of those vouchers to account for higher rent.

Newsom said in the letter dated Monday that state and local governments have increased their support for homeless programs, but “in contrast, your Administration proposed significant cuts to public housing and programs like the Community Development Block Grant.”

But Housing and Urban Development Secretary Ben Carson rejected the housing aid request in a letter Wednesday, saying that California's policies on law enforcement, an overregulated housing market and sanctuary policies regarding people living in the country illegally have driven up housing costs while increasing demand.

"Your letter seeks more federal dollars for California from hardworking American taxpayers but fails to admit that your state and local policies have played a major role in creating the current crisis," Carson wrote.

Carson said that nearly 500,000 California households already receive some kind of federal housing assistance and that "federal taxpayers are clearly doing their part to help solve the crisis."

Courts have limited what cities can do to clean up homeless encampments, the AP reported.

On Tuesday, the Los Angeles County Board of Supervisors voted to join an effort to get the U.S. Supreme Court to review a decision that restricts efforts to bar homeless people from sleeping on sidewalks in Western states.

The board voted 3-2 to file a motion supporting Boise, Idaho, in its efforts to overturn a ruling by the 9th U.S. Circuit Court of Appeals that said it was unconstitutional to arrest or otherwise sanction homeless people who sleep on sidewalks when there aren't enough shelter beds.