Researchers found that even when people had a family history of diabetes or were overweight, they were less likely to get the chronic disease if they were healthy in other ways.
And each additional lifestyle improvement lowered their risk.
"There are implications certainly for individuals to take one step at a time toward a healthy lifestyle," said Jared Reis, one of the study's authors from the National Heart, Lung, and Blood Institute in Bethesda, Maryland.
The data came from more than 200,000 Americans who filled out surveys about their lifestyle, diet and health status in 1995 and 1996, when most were in their fifties and sixties. None of them had diabetes at the start of the study.
Ten years later, researchers sent them another survey asking whether they had been diagnosed with diabetes.
In all, about one in 10 men and one in 13 women reported having the disease.
Looking back at the original surveys, the researchers broke health and lifestyle-related questions into five categories: body mass index (BMI, a measure of weight in relation to height), diet, physical activity, smoking and alcohol consumption.
They found that each healthy behavior listed on that survey -- such as exercising for at least 20 minutes a day, three times per week, or never smoking or quitting at least a decade ago -- lowered a person's future diabetes risk independent of the other lifestyle components.
For example, people who smoked, drank heavily, and got little exercise still had a lower diabetes risk if they ate a healthy diet than if they ate lots of saturated fats and few fiber-rich whole grains.
That was also the case for people who had a family history of diabetes, and so were at higher risk to begin with.
Overall, normal-weight women who ate a healthy diet, exercised, drank moderately and didn't smoke were 84 percent less likely to get diabetes than women who were overweight and didn't fit any of the criteria for a healthy lifestyle. For healthy men, the diabetes risk was cut by 72 percent compared to men with unhealthy habits.
Even though heavy people were still better off if they were healthy in other ways, the researchers said weight was the most important factor in predicting who developed diabetes.