Americans with H.I.V. are achieving the once unthinkable: a steady march into older age. But beginning around age 50, many people living with the virus face a host of health problems, from heart disease and diabetes to social isolation and cognitive decline.

And so the medical research community, which some three decades ago developed lifesaving drugs to keep the virus at bay, is now hunting for new ways to keep people with H.I.V. healthier in their later years.

A recent study, for example, showed that a statin drug significantly lowered the risk of heart attacks and strokes among middle-aged and older adults with H.I.V., and may reveal biological insights into why this group tends to age faster than others. And a crop of academic hospitals have established specialized clinics for older people with the virus, offering medical experts as well as social workers, substance abuse counselors, psychologists and nutritionists.

“I have been unbelievably impressed at how care for the older H.I.V. population has really exploded,” said Dr. Nathan Goldstein, who heads one such clinic at Mount Sinai in New York City. “I get emails every day about new models, new grant funding. People are paying so much attention to this.” More than two dozen H.I.V. and aging experts also expressed optimism, in contrast to the more grim perspective many held a decade ago.

Researchers have often referred to a looming “silver tsunami” of older people with H.I.V. needing better care. In 2021, there were 572,000 Americans aged 50 and older diagnosed with H.I.V., up 73 percent from 2011.

Today, two-thirds of deaths in the H.I.V. population are from causes other than the virus. This aging group faces an increased risk of diabetes, liver and kidney disease, osteoporosis, cognitive decline and various cancers.

But perhaps their most pressing health concern is a doubled risk of cardiovascular disease compared with people who do not carry the virus. Researchers in the Netherlands estimated that by 2030, more than three-quarters of that country’s H.I.V. population will have cardiovascular disease, including high blood pressure, high cholesterol, heart attacks or strokes.

Seeking a bulwark against this mounting threat, the National Institutes of Health invested $100 million in a randomized controlled trial, called Reprieve, that tested a statin medication against a placebo among 7,769 people with H.I.V. 40 to 75 years old. The volunteers were relatively healthy and on stable antiretroviral treatment, so they typically would not have been recommended a statin. But the results of that trial, published in The New England Journal of Medicine, showed that the drug lowered the volunteers’ risk of major cardiovascular events by more than one-third.

“This is really an important study,” said Dr. Anthony S. Fauci, who as the former director of the National Institute of Allergy and Infectious Diseases — he retired in December — was among the N.I.H.’s leaders who approved Reprieve’s mammoth budget. “The results, in some respects — they’re even better than I would have expected.”

Donté Smith, a health consultant from Kansas City, Mo., is 37 but began taking a statin earlier this year. Mx. Smith, who is genderqueer and uses gender-neutral pronouns, said they were motivated to take the medication because, in addition to H.I.V., they had a family history of cardiovascular disease and diabetes and had smoked on and off.

Mx. Smith also noted that the virus took an extra toll on Black and L.G.B.T.Q. people. Of the nearly 1.1 million Americans diagnosed with H.I.V., 63 percent are gay and bisexual men, and 40 percent are Black.

“A lot of us don’t make it,” Mx. Smith said. “It’s important to buck that trend. The best revenge for me is being an elder and being able to share and exist and to still be here.”

Heart disease and other conditions occur disproportionately among H.I.V.-positive people in part because of environmental risk factors that are more common among this group.

“People aging with H.I.V. are more likely to continue to smoke cigarettes, consume unhealthy amounts of alcohol and use cocaine than people aging without H.I.V.,” said Dr. Amy Justice, a clinical epidemiologist at Yale School of Medicine who studies this population. “Each of these behaviors adds to the excess risk of cardiovascular disease.”

Even without those risk factors, aging is accelerated in people with H.I.V. Researchers have long believed the reason to be chronic inflammation and immune dysregulation spawned by the virus, even when it is controlled by antiretroviral drugs.

Dr. Steven Grinspoon, Reprieve’s lead author and a professor at Harvard Medical School, said that the clinical trial also measured many chemical markers of inflammation in the volunteers’ blood and scanned their coronary arteries. The researchers are now looking at whether these data can help explain why the statin lowered cardiovascular events. The researchers will present their findings at a meeting in November.

Dr. Fauci suspected that this analysis will likely reveal that the statin tamped down the volunteers’ chronic inflammation, and in turn prevented the plaque buildup in the arteries that can precipitate a heart attack or stroke.

But experts said that the long-term care of people with H.I.V. will depend on much more than prescription drugs. An array of social problems are especially prevalent among older people with H.I.V. and can exacerbate the perils of aging, including poverty, loneliness, addiction, mental illness, stigma and housing insecurity.

Paul Aguilar, 60, was given five years to live when he was diagnosed with H.I.V. in 1988. He has survived, but not without struggle. The fat has drained from his face, a side effect of the toxic early generation of antiretroviral drugs. And he has weathered waves of lost peers in San Francisco: first from AIDS and more recently from other illnesses.

Last year, he began going to the “Golden Compass” program for aging H.I.V. patients at the University of California, San Francisco, which provides a panoply of services, including cardiology, exercise classes and dental, vision and mental health care. He said that the psychological counseling and support he received there helped him cope with his closest friend’s death by suicide and his own subsequent mental health crisis.

The university’s program is “really a godsend,” Mr. Aguilar said, noting that he has no out-of-pocket costs, thanks to his coverage from Medicare and Medicaid.

But the vast majority of older people with the virus still lack the type of high-quality care that has helped Mr. Aguilar thrive, experts said. Such programs are often prohibitively expensive and pose staffing and space demands that many clinics, especially in resource-poor areas, cannot hope to meet.

“Patients are falling through the cracks,” said Jules Levin, 73, a leading activist holding the bullhorn on behalf of H.I.V.-positive seniors such as himself.

After learning about the Reprieve study’s findings, Mr. Aguilar asked his doctor about starting a statin.

“I’m going to be crotchety and telling kids to get off my lawn,” he quipped.