Homelessness has declined across most of the U.S. over the last decade as the economy has crawled back from the housing crash. In some cities, however, the problem is getting worse, with researchers pointing to a one culprit in particular: rising rents.

A new analysis from Zillow found that the incidence of homelessness is growing faster in the least affordable rental housing markets, including Los Angeles, New York, San Francisco and Washington, D.C.

"It's undoubtedly good news that the overall level of homelessness has fallen nationwide, even as housing costs have increased. But that zoomed-out view obscures some very real, local tensions between housing affordability and homelessness, and ignores the reality that success in tackling homelessness in one community doesn't necessarily have the same effect in another," said Skylar Olsen, director of economic research and outreach at Zillow, a provider of real estate data, in a statement.

Get Breaking News Delivered to Your Inbox

In cities with high housing costs, even a modest rent increase can significantly drive up homelessness, found Zillow, which did the study in collaboration with researchers at the University of New Hampshire, Boston University School of Social Work and University of Pennsylvania.

In Los Angeles, where the rent burden — the share of income people spent on rent — is 49 percent, a 2 percentage point increase in that metric could result in an additional 4,000 people finding themselves on the street, according to the report.

"We particularly noticed it around 2014 when we were housing more people than ever... yet our streets looked terrible," said Molly Rysman, Housing and Homelessness Deputy, Los Angeles County District 3, referring to widely circulated pictures of people sleeping on the city's sidewalks.

Notably, the rate of homelessness jumps sharply when the rent burden exceeds 32 percent, such as in cities like Portland, Oregon, and Seattle, Washington. The rent burden already exceeds that threshold in 100 real estate markets across the country, according to the analysis.

How much should renters spend?

Homelessness in the U.S. has dropped about 13 percent since 2010, according to the U.S. Department of Housing and Urban Development. Nationwide, some 661,000 people were homeless for some period of time last year, the researchers found.

Nationwide, a renter earning the median U.S. income — roughly $61,000 per household in 2017 — looking to rent a median-priced apartment should expect to spend 28 percent of their income on rent, according to the study.

"Before 30 percent, savings are possible, until you go past 32 percent the strength of relationship between rent burden and homelessness gets much stronger," Olsen said.

That's the pattern in cities like Los Angeles and New York, she said, while cautioning that the problem of homelessness in such cities is complex and that the remedies are unclear.

Many Americans find they have to spend above levels that would allow them to save — rent burdens are as high as 62.9 percent for median market homes in Monroe County, Florida.

The data provide an opportunity to tackle homelessness before it becomes a crisis, the researchers wrote. "These affordability thresholds — along with local poverty rates and the level of rent itself — act as signals for understanding how so many parts of the country can face a homeless crisis, even as the number of people in homelessness nationwide is falling."