PHOENIX — Five years on the Phoenix streets battered Vance Blair’s body. His vision dimmed, his speech slowed and his hands began to twitch. A bulging pelvis revealed the need for hernia surgery, and the vacant lot where he slept was no place to keep dressings clean.

Blair often lingered by a shaded building, and several women who worked there grew fond of the diffident man who asked permission to escape the sun. They brought him food and discovered his dilemma: Medicaid would cover his operation, but hospitals discharge patients quickly and surgeons would not proceed unless he had a place to heal.

Then they learned that a Phoenix group runs what amounts to a nursing home for the homeless. Blair has remained there since his operation six months ago and says the care might have saved his life.

“After a while of being outside, I was having thoughts of not wanting to live anymore,” he said. “This place has been a great help.”

Respite care for homeless people is rapidly growing, aimed at people well enough to leave the hospital but too sick for the street. Its rise reflects the aging of the unhoused population and the decadelong expansion of Medicaid, which helps cover the cost. Many programs also get subsidies from hospitals or insurance companies eager to shorten hospital stays or reduce readmissions.

The number of programs, mostly nonprofit, has roughly doubled since 2016, to more than 165, according to the National Institute for Medical Respite Care. The movement has spread to places including Greenville, South Carolina; Memphis, Tennessee; and Missoula, Montana, underscoring the ubiquity of homelessness.

With two 50-bed sites and a roster of clinicians, the Phoenix program, Circle the City, is one of the most sophisticated. Patients have an average age of 56 and bodies that seem much older. They crowd the halls with wheelchairs, walkers, intravenous lines and colostomy bags, markers of debilitation that without shelter would carry the risk of infection or assault.

Proponents of respite care hail the movement as a humanitarian imperative and a sensible way to control health care costs.

“We make sure people have a humane place to go and keep them from bouncing back to the emergency room,” said Kim Despres, the CEO at Circle the City.

But some programs offer only rudimentary care, more like shelters than nursing homes. Critics fear the movement could divert patients into second-class convalescence and obscure the need for permanent housing.

“Hospitals use respite care to get indigent patients off their books, and then they’re often discharged back into homelessness,” said Dennis Culhane, who studies aging and homelessness at the University of Pennsylvania.

Homeless patients should be cared for in licensed nursing homes, he said, alongside the general population.

A challenge in respite care is what to do when patients get well: Many have nowhere to go. Caseworkers at Circle the City often spend months helping patients make plans, but high rents and the shortage of housing aid mean some return to the streets.

“It’s very scary for them to be with us for two or three months and then have to leave,” Despres said.

A visit to Circle the City is a tutorial on the infirmity that can accompany homelessness.

Sheila Meade, 62, uses a walker after a hysterectomy. Armando Sanchez, 42, lost five toes to diabetes. Quintin Alston, 62, had a hip replaced. Kenson John, 50, who has paraplegia, is recovering from toxic shock. Until recently, all were sleeping outdoors or in shelters.

The aging of the homeless population is a stark demographic shift.

In a forthcoming study with Thomas Byrne, Culhane found that by 2020 the largest cluster of homeless men were in their mid-50s, up from mid-30s three decades earlier. The share of the population that was 60 and older had more than doubled, to 19%. He says the trend reflects the plight of late baby boomers who matured amid deindustrialization and soaring housing costs, then carried the scars through life.

Margot Kushel, director of the Benioff Homelessness and Housing Initiative at University of California, San Francisco, found that unhoused people have the health profiles of patients two decades older, with similar rates of incontinence, dementia and falls.

Worn by lives of poverty, weakened by high rates of addiction and injury, and unable to manage treatable diseases including diabetes and cancer, they suffer mortality rates 3.5 times those of the general population, Kushel found.

By insuring an additional 15 million people in or near poverty — the main risk pool for homelessness — the Medicaid expansion that started with the Affordable Care Act of 2010 gave respite programs new ways to recover costs.

Five states have federal permission to cover respite care directly. In other states, respite programs can bill Medicaid for discrete services, such as supplying wheelchairs or conducting exams.

Respite care has also grown, albeit more modestly, in the 10 states that have rejected the Medicaid expansion, driven by sheer need. With less funding, they tend to offer fewer services.

Circle the City, which opened in 2012, was willed into being by a Phoenix nun who sought donations with a shoebox. Now the nonprofit group has a $32 million budget and a staff of 260, including physicians, nurse practitioners, licensed social workers and mobile medical vans.

About three-fourths of Circle the City’s patients leave with housing plans, including subsidized apartments, addiction programs or temporary stays with friends, Despres said. That still leaves one-fourth leaving for sidewalks or shelters, and others return to homelessness after their makeshift arrangements dissolve.

Circle the City also offers hospice care. Its terminally ill patients include Douglas Botsford, 57, who arrived in April with a failing heart and a life story that he shares with a raconteur’s flair. It involves a sales career in auto parts, a vindictive ex-girlfriend and an addiction to methamphetamine that left him living in his car with his soul mate, a pit bull named Mia.

She died two years ago.

Botsford suffered a heart attack two days later and learned he had little time to live.

“My heart died when my dog did,” he said.

Hospitalized with another heart attack, Botsford was discharged to a shelter that could not care for him and was sent back to the hospital — the exact scenario that respite care seeks to avoid. He assumed he would die on the street, until Circle the City offered care.

“I’m a very lucky man to have the chance to die here,” he said.