Eating healthier by including more fruits, vegetables and whole grains in your diet reduces the risk of type 2 diabetes by up to 20 percent, a new study finds.

Eating habits and lifestyle play a major role in determining whether a person enjoys good or bad health. These two are also risk factors for type 2 diabetes. A new study finds that eating healthier by including more fruits, vegetables and whole grains in your diet reduces the risk of type 2 diabetes by a significant margin.

The study was conducted on a group of participants who were followed for four years. During this period, researchers found that those who improved their eating habits by 10 percent and above enjoyed a 20 percent reduction in type 2 diabetes risk.

"If you improve other lifestyle factors you reduce your risk for type 2 diabetes even more, but improving diet quality alone has significant benefits," said lead researcher Sylvia Ley, PhD, a post-doctoral fellow at the Harvard School of Public Health, in a press statement. "This is important because it is often difficult for people to maintain a calorie-restricted diet for a long time. We want them to know if they can improve the overall quality of what they eat - consume less red meat and sugar-sweetened beverages, and more fruits, vegetables and whole grains - they are going to improve their health and reduce their risk for diabetes."

Researchers also looked to see if improved dietary habits also indicated other lifestyle changes including weight loss and physical activities. They found that diet was associated with diabetes independent of weight loss and increased physical activity. The researchers also noted that improved eating habits provided health benefits, irrespective of how good or bad a person's diet was when they started out.

This is not the first study that has highlighted the effects of a person's dietary patterns on diabetes. A recent study also found that fasting can help ward off diabetes risk. Researchers from the Intermountain Medical Center Heart Institute found that after 10 to 12 hours of fasting the body starts searching for other sources of energy. The body tends to pull LDL (bad) cholesterol from the fat cells to use as energy. This, in turn, reduces diabetes risk by about 12 percent.

Diabetes remains the 7th leading cause of death in the United States, with 69,071 death certificates listing it as the underlying cause of death. A total of 234,051 death certificates listed diabetes as an underlying or contributing cause of death in 2013, according to CDC estimates.

The current study was funded by the National Institute of Diabetes and Digestive and Kidney Diseases, part of the National Institutes of Health. Findings were presented at the American Diabetes Association's 74th Scientific Session.