NAIROBI, Kenya — Hannah Wanjiru was plagued by dizzy spells and headaches for years. After a half-dozen costly trips to the doctor, she was finally diagnosed with high blood pressure. It took two more years — and some fainting spells — before she finally started to take medication. By then, her husband, David Kimani, had been shuttling between doctors himself and ended up with a diagnosis of diabetes, another condition the couple knew nothing about.

They might have wished for different diseases. Not far from their small apartment in the Kenyan capital, there is a public hospital where treatments for H.I.V. and tuberculosis are provided for free. Posters for free H.I.V. prevention services paper the streets in their low-income neighborhood.

There is no such program for high blood pressure or diabetes, or for cancer or chronic respiratory conditions. The health systems in Kenya and much of sub-Saharan Africa — and the international donations that support them — are heavily weighted to the treatment of infectious diseases such as H.I.V. and malaria.

“Sometimes I go to have my sugars tested and I wait all day and I am almost fainting right there in the lineup,” said Mr. Kimani.

Success in fighting H.I.V., malaria and other deadly infectious diseases, plus an expansion of essential services, have helped countries in sub-Saharan Africa achieve extraordinary gains in healthy life expectancy over the past two decades — 10 additional years, the largest improvement in the world, the World Health Organization reported recently.

“But this was offset by the dramatic rise in hypertension, diabetes and other noncommunicable diseases and the lack of health services targeting these diseases,” the agency said, launching a report on health care in Africa. It warned that the rise in life expectancy could be erased before the next decade is out.

Noncommunicable diseases now account for half of hospital bed occupancy in Kenya and more than a third of deaths. The rates are similar across the rest of sub-Saharan Africa, and people in this region are being affected at younger ages than those in other parts of the world.

“Vaccination programs are running very well, H.I.V. programs are running very well — but these same people will die of noncommunicable diseases while they are young,” said Dr. Gershim Asiki, a research scientist focused on management and prevention of these conditions at the African Population and Health Research Center, an independent organization in Nairobi.

The medications and supplies Ms. Wanjiru, 44, and Mr. Kimani, 49, need to control their conditions cost $60 each month, a huge portion of the income from their small convenience store, Ms. Wanjiru said over tea in their sitting room. Both skip their medication on months when school fees are due for their four children.

“I get headaches and I feel weak, and then I feel stressed knowing I need to buy medication instead of food for my family,” Mr. Kimani said.

Routine screening for conditions such as high blood pressure is rare here, diagnosis rates are low and care is often available only at specialized centers in urban areas. The public is not aware of the ailments — everyone can recognize malaria, but few connect blurry vision or exhaustion with hypertension — and primary care health workers often don’t know what to check for either.

When Dr. Asiki’s organization set up random screenings in a low-income community in Nairobi a couple of years ago, researchers found that a quarter of adults had hypertension. But 80 percent of them did not know they had it. Of those who did, fewer than 3 percent were controlling their blood pressure with medication.

A fraction of Kenya’s health budget goes to noncommunicable disease — it was 11 percent in 2017-18, the latest figures in the government’s strategic plan — and those funds are mostly earmarked for expensive curative services such as radiation machines at cancer clinics and kidney dialysis centers. “But people come with cancers that are already Stage 4, with very little chance of survival, because they cannot get diagnosed,” Dr. Asiki said.

Government ministers like to cut the ribbon on new cancer centers, but there is no perceived political value in investing in a long-term screening program, said Catherine Karekezi, executive director of the Kenyan chapter of an international patient advocacy organization called the Noncommunicable Disease Alliance.

“Eighty percent of deaths from noncommunicable disease in this country are from preventable causes,” Dr. Karekezi said. “We can prevent the causes, and if you do have the condition, we could prevent you from progressing to complications.”

Instead, she said, younger people are falling ill and developing serious complications, and are sometimes unable to work. “It’s the economically active segment of the population that is affected,” she said.

People die of undiagnosed heart disease or complications from diabetes in their 50s and that’s chalked up to “old age.” The systems to accurately track causes of death are weak, which means that neither the public nor policymakers understand the true scale of the problem, Dr. Asiki said.

Unlike H.I.V. medication and care, which is usually free and subsidized by international donors, treatment for diabetes or blood pressure are usually out-of-pocket expenses for families, and often cripplingly expensive, said Dr. Jean-Marie Dangou, who coordinates the noncommunicable disease program of the W.H.O.’s Africa regional office.

“In the Democratic Republic of Congo, hypertension treatment is two-thirds of the typical household income each month,” he said. “That’s absurd, for that family. But it is not unusual.”

Annah Mutindi, 42, used up all her savings from her job as a clerk in a Nairobi dress shop on doctor visits and tests before a painful lump in her breast was diagnosed as cancer in January 2021. She was prescribed a course of 12 biweekly sessions of chemotherapy. She could have had them for a minimal cost, in theory, at a large public hospital in the center of the city, but the treatment was continuously out of stock.

Instead she had to wait until her family and friends scraped together $360 every few weeks so she could pay for the treatments one by one, stretched over the next nine months.

“I was in shock when they told me it was cancer, because I never touch alcohol and I eat healthy,” Ms. Mutindi said, recalling her diagnosis. “They said maybe it was environmental factors.”

The share of deaths caused by noncommunicable disease is increasing across the region, most rapidly in the continent’s most populous states, Dr. Dangou said. In Ethiopia, for example, mortality caused by these conditions climbed to 43 percent of deaths last year from 30 percent in 2015, and made a similar jump in the D.R.C.

It is clear that rapid urbanization and an increase in sedentary lifestyles is driving some of the increase in these conditions. So is growing use of tobacco and alcohol, and consumption of processed foods.

Kenya’s government has been slow to update policies to discourage these. And all three industries have powerful lobbying organizations that are focused on stalling legislation such as a tax on sugar-sweetened beverages. Kenya is a major producer of tobacco and the industry reminds the government of the jobs it creates, Dr. Asiki said

There’s also the simple fact that people are living longer because of the progress fighting infectious diseases. But others causes, such as possible genetic factors and a correlation with exposure to infectious disease, are less understood.

There is little public investment in researching the mystery of why noncommunicable disease rates are rising so quickly, and in comparatively younger people, in this region.

The experience of high-income countries is of limited relevance to the situation in a country such as Kenya, Dr. Asiki said. Scarcity of nutritious food in childhood appears to prime people metabolically for obesity in adulthood. There is some evidence that malaria infections predispose people to cardiovascular disease; hepatitis infections put them at risk for cancer.

Taking the antiretroviral drugs that control H.I.V. for years can lead to a higher risk of heart disease. Urban dwellers are also exposed to increased rates of air pollution and environmental toxins, and some to the stress of living in areas with high rates of violence and insecurity. All of these are contributing factors, Dr. Asiki said, but their combined effect is not yet well understood.

Dr. Andrew Mulwa, who directs preventive and health promotion programs for the Kenyan Ministry of Health, said the government was concerned about the soaring rates of noncommunicable conditions, but that it was slow work rolling out diagnostics and treatment to the primary care level in rural areas.

“When I worked as a clinician in a rural area 10 years ago, you would see 50 patients a day with these conditions, and now it is 500 to 1,000 at the same facility,” he said.

Poor nutrition is influencing the rise of noncommunicable diseases in multiple ways — what Dr. Asiki calls “a double burden of under-nutrition.” This region is home to both the largest number of stunted children in the world and the fastest-rising rate of obesity.

It is common in low-income households to find both malnourished children, who lack the protein and nutrients essential for growth, and adults who are obese, because they are reliant on cheap, fatty and energy-dense street foods — often a more affordable option than paying for vegetables and cooking gas to make food at home.

“You can have enough of the bad food but scarcity of the needed foods,” Dr. Asiki said. “The body stores excess energy as fat — but at the end it’s still scarcity.”

He speculated that the government had been slow to roll out screening programs because there was no way it could respond to the extent of the problem.

“That’s when you suddenly realize, I don’t have enough medications for hypertension, I don’t have enough medications to treat people with cancer,” Dr. Asiki said. “If you screen, you will pick cases that are treatable. But do we have the resources to treat them?”