Can you be fit and healthy, even if you are overweight? And will working out, despite the extra pounds, reduce your risk of a heart attack?

The idea that you can be “fat but fit” has long been controversial. While health experts endorse physical activity as beneficial, many doctors view the concept of being “fat but fit” with suspicion.

A new study, believed to be the largest of its kind, suggests that even when overweight or obese people are free of health complications, they are still more likely to develop heart disease than their peers who are not overweight.

It did not matter whether obese people were free from diabetes, high blood pressure or high cholesterol, a condition sometimes referred to as “metabolically healthy obesity.” As long as they were obese, they were at modestly higher risk for having a stroke, at nearly 50 percent greater risk of coronary heart disease and had nearly double the risk of developing heart failure than people who were not overweight and in similar metabolic health.

People who were metabolically healthy but considered merely overweight were at a 30 percent greater risk of coronary heart disease compared with their normal weight and metabolically healthy peers.

“The bottom line is that metabolically healthy obesity doesn’t exist,” said Dr. Rishi Caleyachetty, of the College of Medical and Dental Sciences at the University of Birmingham in England, who was the lead author of the paper, published in the Journal of the American College of Cardiology. “Obesity is not a benign condition.”

But critics say the analysis, based on the electronic health records of 3.5 million British patients who were followed from 1995 to 2015, leaves a lot out. Doctors’ records do not typically capture lifestyle habits, so the study fails to account for the wide-ranging effects of diet. They classify weight status by using body mass index, a formula based on height and weight that does not distinguish muscle from fat. Most important, critics say, such analyses do not take fitness level or physical activity into account.

Other studies have found a higher rate of heart failure among obese individuals, said Dr. Carl Lavie, the medical director of cardiac rehabilitation and preventive cardiology at the John Ochsner Heart and Vascular Institute in New Orleans. But when it comes to coronary heart disease outcomes, studies that take both weight and physical fitness into account have concluded that “fitness is more important than fatness,” at least for the moderately obese, he said.

“For the very large number of people who are overweight or mildly obese, I don’t think it’s doomsday if they can keep themselves out of the low fitness level,” Lavie said.

Caleyachetty, the author of the new paper, agreed that the lack of information about fitness and exercise was “an important caveat.”

“Those people who are metabolically healthy, obese and vigorously active may have a decreased risk of developing cardiovascular disease,” he conceded.

Critics say that is an important message to convey, because many people will find it easier to embark on an exercise regimen and stick with it than to lose weight and maintain the weight loss.

“I do think that’s a better message than telling people, ‘You better not gain weight,’ ” Lavie said. “People aren’t trying to gain weight. They’re not trying to get to be obese. A better message would be to tell people that if they get themselves to be more physically active, they can improve their prognosis, despite carrying a few extra pounds. That’s a better message, and a more obtainable message.”

But Jennifer Bea, an assistant professor of medicine at the University of Arizona Cancer Center who was a co-author of an editorial accompanying the new study, said, “we haven’t heard the whole story yet” and questioned whether someone can be obese but “metabolically healthy.”

“Obesity itself is a metabolic disorder,” Bea said, noting that being overweight and obese is often associated with low-grade inflammation that may contribute to cardiovascular disease, regardless of metabolic measures.

That does not mean that weight trumps all. Indeed, the study found that individuals who were considered to be of normal weight but who had a single risk factor such as diabetes, high blood pressure or high cholesterol were actually at greater risk for coronary heart disease than the healthy obese people.

“The messaging is always, ‘lose weight no matter what,’ ” said Patrick Bradshaw, an epidemiologist at the School of Public Health at the University of California, Berkeley. “But when you’re at normal weight, you’re not given a lot of lifestyle guidance. Your doctor may say ‘exercise and eat right,’ but if you have these metabolic abnormalities you’re at higher risk of disease, and you may need more intensive lifestyle modifications — not to lose weight, but to improve health.”

One of the messages of this new paper “is that metabolic health is important regardless of your weight,” Bradshaw said.

That goes for people who are considered underweight as well. The new study found, for example, that underweight individuals with no metabolic problems were at higher risk for stroke than normal weight, overweight or obese people with no metabolic problems, and if underweight people had metabolic issues, their risk increased even further.