JOHANNESBURG – The experts gathered from around Africa were here to talk about an epidemic, but it wasn’t AIDS or malaria — it was diabetes, and the bad habits that often bring it on.

A growing urban middle class is defying the image of Africa as poor, underfed and undermedicated. And afflictions familiar in the West are making inroads here, too — obesity, diabetes, lung cancer, strokes, heart disease.

A continent that traditionally traveled on foot or by bike now increasingly rides cars and buses. More time is spent at desks. Elevators are replacing stairs.

“In the past, we used to exercise without knowing it,” South Africa’s health minister, Aaron Motsoaledi, 52, reminded the recent conference.

“You would walk a long distance to school. You would walk a long distance to work. You would walk a long distance to the shops,” he recalled of his childhood. “But now I’m an African whose child is dropped at the gate of the school in a car, then picked up at the end of the day and put in front of the TV.”

All over the world, these lifestyle diseases tend to go hand in hand with urbanization and industrialization, and the results are felt in rising obesity rates and related illnesses. But they are all the more unwelcome in Africa, which already struggles with AIDS and malaria.

Dr. Timothy Armstrong, an expert on chronic diseases with the U.N. World Health Organization, wonders how a doctor treating AIDS or malaria can find time to lecture patients about watching their weight.

Armstrong wants African governments to follow the West’s lead with tobacco taxes and pressure on the food industry to cut salt and sugar content. But awareness often is lacking.

Fatima Macuacua, 31, owns a grocery store in Maputo, the capital of Mozambique, and refuses to believe her favorite fast foods could be bad for her.

“Cancer, diabetes, high blood pressure and other diseases are not a big problem for Africans,” she insists.

Besides, for many on the world’s poorest continent, issues of food are more basic than gluten and trans fatty acids. The rise of lifestyle diseases is too recent for solid statistics to exist. Kenyan health authorities say only this year did they start counting cases of obesity and fatal heart attacks and strokes.

But at least the problem is getting attention.

South Africa, with the continent’s most developed economy, has stood out in addressing the threat of lifestyle diseases. A rise in cigarette taxes has been linked to a fall in smoking and smoking-related diseases since the 1990s. Smoking is banned in public places, and legislation is being drafted to limit artery-clogging trans fats in food.

Still, the Heart and Stroke Foundation of South Africa estimates a third of the men and more than half the women here are overweight or obese.