“The greatest risk, however, of the ketogenic diet may be the one most overlooked: the opportunity cost of not eating high-fiber, unrefined carbohydrates,” the authors wrote. “Whole grains, fruits and legumes are some of the most health-promoting foods on the planet. They are not responsible for the epidemics of Type 2 diabetes or obesity, and their avoidance may do harm.”

Dr. Shivam Joshi, a co-author of the piece, said it generated a flood of emails from people across the globe. Some expressed praise and support, while others offered condemnation, a sign of just how polarizing the diet can be, said Dr. Joshi, an attending physician at NYC Health + Hospitals/Bellevue and a clinical assistant professor at New York University medical school.

“It’s a hot-button issue, and this paper struck a chord,” he added.

While the ketogenic diet can seem like the latest in an endless stream of fad diets, it has a long history of therapeutic uses. Diabetics routinely practiced carb restriction before the discovery of insulin in the 1920s, and doctors at Johns Hopkins and other hospitals have used the diet for almost a century to reduce seizures in patients with epilepsy.

One of the benefits of carb restriction is that blood sugar levels remain stable after a meal, resulting in lower levels of insulin, a hormone that causes weight gain, said Dr. David Ludwig, an endocrinologist at Harvard Medical School and the author of a best-selling book on low-carb diets.

“Insulin is like a Miracle-Gro for fat cells,” he said. “By lowering insulin levels, fewer calories from the meal may get stored in fat cells, leaving more to fuel metabolism and feed the brain. As a result, you may feel fuller longer after eating.”

In a series of studies over the years, Dr. Ludwig has found that low carb diets cause people to burn more calories and lose more weight compared to lower fat diets. According to the carb and insulin theory of obesity, whole grains, starchy vegetables and tropical fruits are more healthful than processed carbs. But they can still cause swings in blood sugar and insulin after a meal, and that can be particularly problematic for people with diabetes, said Dr. Ludwig.

In May, the American Diabetes Association published a consensus statement on nutrition strategies for people with diabetes. It found that a variety of diets rich in unprocessed foods, like the Mediterranean and vegetarian diets, could help people prevent and manage the disease. But it also concluded that reducing overall carb intake “has demonstrated the most evidence” for improving blood sugar control.