A federal report released Monday provides a possible glimmer of hope for the homeless crisis that has gripped many cities up and down the West Coast.

The number of people living on the streets in Los Angeles and San Diego, two epicenters of the homelessness crisis, fell this year, suggesting possible success in those cities’ efforts to combat the problem.

Cities in California, Oregon and Washington have driven an overall spike in the number of homeless people nationwide in recent years. This year’s count continued that trend, showing 552,800 people without homes across the country, up by about 2,000 from 2017, according to the U.S. Department of Housing and Urban Development’s point-in-time tally. It was the second consecutive increase after seven straight years of declines.

The number of people living in the streets, encampments or other unsheltered places was more than 194,000 — also up from last year.

But the decrease in Los Angeles and San Diego is a rare positive sign in cities that have struggled to cope with an exploding homeless population. It also comes as those cities are planning to spend big on affordable housing and other steps.

Nationwide, the overall increase this year was driven by a 2 percent rise in the unsheltered homeless population — those living in vehicles, tents and on the streets.

Last year, for instance, Los Angeles voters approved $1.2 billion to build 10,000 units of affordable housing over a decade. Local officials there also have ramped up outreach efforts to connect homeless people with services.

This year’s point-in-time count, conducted in January, found just under 50,000 homeless people in the city, with three-quarters of them unsheltered. Both numbers were down from the year before.

San Diego, California’s second most populous city, also saw a decline in both total homelessness and those on the streets. After a hepatitis A outbreak spread among the homeless population and killed 20 people in 2017, the city turned to industrial-sized tents to house hundreds of people. As the tents went up, officials also cited people camping on downtown streets. Encampments downtown cleared out quickly, but the number along the San Diego River doubled.

The city is considering a ballot measure to raise money for affordable housing in 2020.

Nationwide, the overall increase this year was driven by a 2 percent rise in the unsheltered homeless population — those living in vehicles, tents and on the streets — along with 4,000 people in emergency shelters after hurricanes, wildfires and other disasters, according to HUD. The numbers of homeless veterans and families continued their long-term declines.

At a time when rents are rising faster than wages — especially for lower-income people — an essentially stagnant count is a not a bad sign, said Steve Berg, vice president for programs and policy at the National Alliance to End Homelessness.

“Given what’s going on with rental housing, it’s not exactly good news but it means communities are pushing back against the headwinds,” said Berg, who like other advocates urges caution about reading too much into one-year trends in the homeless count.

The homelessness data picture is incomplete because several West Coast areas with large populations, including San Francisco, Portland, Oregon, and California’s Orange County, did not conduct new counts of unsheltered homeless populations this year. Those places will do fresh surveys in early 2019.

Homelessness has exploded along with a soaring economy in several West Coast cities in recent years and has become a top local political issue. From 2015 through last year, voters on the West Coast approved more than $8 billion in spending — most of it in tax increases — to address homelessness.

In Seattle, which has the nation’s largest homeless population outside New York or Los Angeles, the count this year rose to more than 12,000 — more than half of them unsheltered. The number was less than 9,000 just four years ago, and the city has been wrestling with what to do about the problem.

The City Council in May passed a $48 million tax on businesses to raise money for affordable housing. But under pressure from Amazon, Starbucks and other companies, it repealed it the next month.

HUD Secretary Ben Carson said on a conference call with reporters Monday that no one should be declaring victory over homelessness despite decreases in certain cities.

“We still have a long way to go even though there’s been significant progress,” he said.