Until recently a bustling marketplace for stolen goods and open-air drug trade, the area had been spruced up with a brand-new skate park, and trainees from a dance company performed to a crowd. There was hardly a homeless person to be seen. Police officers and city officials watched too.

By Tuesday, the day of U.S. President Joe Biden's arrival, Christopher Crandall, 50, who usually sleeps on the street in a part of downtown San Francisco west of the APEC convention center, said he'd noticed the city had planted new trees along the arterial Market Street.

He'd also seen waist-high gates going up on Tuesday morning in the area where he usually beds down. "I'm wondering if I will be able to sleep there tonight," he said.

California Governor Gavin Newsom, speaking at an event on Thursday focused on beautifying the state, said local, state and federal leaders had been discussing the issue for months.

"I know folks are saying, 'Oh, they're just cleaning up this place because all those fancy leaders are coming to town.' That's true ... This is momentum. And I want folks to know, you are seeing a lot more of this around town and around the Bay Area."

San Francisco has been waging for years a multi-pronged war on drugs and related crime, homelessness and unaffordable housing. It has grabbed headlines as a city in an economic "doom loop" as some businesses have shuttered, public transport ridership has dropped and offices lie empty after the pandemic.

Officials have tried to clean up the city's streets, with limited success. The crisis has drawn sharp criticism from residents and conservative politicians who have blamed the city's problems on its liberal policies.

Clean up efforts ahead of the summit - where President Biden and China's Xi Jinping will meet - have not convinced some people who are skeptical that these improvements will last.

Forcing homeless people to move - called "sweeps" - will never solve the real problem, which is that there isn't enough affordable housing, said Paul Boden, director of the Western Regional Advocacy Project, a coalition of homeless groups.

"They do this for the Superbowl, they do this for conferences ... but nothing ends homelessness like a home," Boden said.

The city has a homelessness rate of 887 people per 100,000 residents, according to a 2023 report from the San Francisco controller's office on 16 American cities. That was the third-highest rate in the country behind neighboring Oakland, and Los Angeles.

"Where did they go?" Tesla boss Elon Musk on Friday tweeted at a video from conservative media Fox News that reported tents used by the homeless had been cleared. Musk, who bought Twitter now called X last year, has previously tweeted on San Francisco's problems.

The company's headquarters abut the Tenderloin, the city neighborhood that is usually full of homeless encampments and people taking and selling drugs.

Trevor Chandler, a public school teacher who is running for local office, said many residents in his district noticed homeless encampments getting pushed away from near the APEC conference and into their neighborhood.

"I've knocked on 2,000 doors and what voters are telling me is they are sick of Band-Aids going on these problems and pushing them elsewhere. That is why people are both simultaneously excited and upset to see how clean downtown is right now," he said.

(Reporting by Peter Henderson and Anna Tong in San Francisco; Editing by Sayantani Ghosh and Stephen Coates)

By Anna Tong and Peter Henderson