Eating red meat, and in particular processed red meat like bacon and hot dogs, raises the risk of Type 2 diabetes. But replacing just one serving a day with nuts or low-fat dairy can lower the risk, according to a study by Harvard researchers.

Many other investigators have explored the link between diabetes and meat consumption, but this study is the largest and most comprehensive on the subject to date, following hundreds of thousands of people over the course of several decades. It is also the first to look not only at whether red meat consumption heightened the risk, but also at whether replacing meat with dairy or plant-based proteins like nuts and whole grains could make a difference.

The findings come from a broad analysis of three groups of male and female health professionals, totaling nearly 300,000 people ages 25 to 75. The researchers looked at their eating and health habits dating to 1976. The subjects answered detailed questions about their diets and medical history and provided updated information every two years.

Over all, the authors found that eating a daily serving of unprocessed red meat, equivalent to a 100-gram cut of steak, roughly the size of a deck of playing cards, was enough to raise the risk of Type 2 diabetes by 19 percent. Eating just 50 grams a day of processed meat — one hot dog or sausage, for example, or a little more than two strips of bacon — increased the risk 51 percent. In addition to bacon and sausage, processed meats include deli and luncheon meats, among them salami, bologna and ham.

But the researchers then decided to see what would happen if a person who regularly ate red meat limited consumption of it, a measure advocated by many health officials as well as environmentalists. Using mathematical models, the researchers calculated the benefits of replacing one serving of meat with nuts and found it resulted in a 21 percent lower risk of Type 2 diabetes. Choosing a serving of Greek yogurt or another low-fat dairy product over red meat decreased the risk 17 percent, and whole grains reduced the risk by 23 percent. Even substituting poultry or fish for red meat lowered the risk of developing diabetes.

Dr. Frank Hu, a professor of nutrition and epidemiology at the Harvard School of Public Health and an author of the study, said the results should send a clear message that Americans need to reduce their intake of red meat.

“It’s a very important message, given that diabetes is rising very rapidly and consumption of red meat, including both processed and unprocessed, is very high,” he said. “We’re talking about switching from a meat-centered diet to a more plant-based diet for the prevention of diabetes and other chronic diseases.”

Across the United States, more than 11 percent of adults, or about 25 million people, have diabetes, many the Type 2 form linked to diet, obesity and inactivity. According to the United States Department of Agriculture’s most recent statistics, the average American eats more than 100 pounds of red meat every year.

Dr. Hu said he would recommend that the average person eat no more than one serving of processed meat a week and limit unprocessed red meat to two or three servings a week. “I think that’s the level that above which it appears to be associated with a substantially increased risk,” he said.

Other studies have linked red meat consumption to heart disease and Type 2 diabetes, but most have focused primarily on processed meat, had relatively small sample sizes or looked at men and women separately. Another question that has plagued previous studies was whether meat was in fact a hazard or whether other less than healthful habits associated with a high meat intake — like smoking, less exercise and a greater body mass index — were the real culprits.

In the current study, published in The American Journal of Clinical Nutrition, the researchers did find that people who ate more red meat were more likely to smoke and avoid physical activity. They also tended to eat more calories over all and had higher B.M.I.’s. But even after adjusting for all of those factors, an elevated risk involving red meat intake and Type 2 diabetes remained.

So what is it about red meat that could cause the connection?

The authors proposed several theories. For one, processed meat contains high amounts of sodium and chemical preservatives like nitrates, which can damage cells in the pancreas involved in the production of insulin. Red meat in general also has high levels of a type of iron called heme that, when consumed in high amounts, can increase oxidative stress and lead to chronic inflammation, which can also affect insulin production.

Dr. Hu said the simple fact that people who eat a lot of red meat tend to gain more weight was also a factor, since obesity and Type 2 diabetes are intertwined.

“But even after adjusting for B.M.I. we still showed a significantly elevated risk,” he said, “so it means that the greater risk goes beyond the obesity link.”