Type 1 diabetes and the food intolerance disorder coeliac disease appear to share a common genetic origin, UK research suggests.
The genetic similarities are such it suggests they may also be triggered by similar environmental factors.
This raises the possibility that the protein gluten, already known to cause coeliac disease, may also trigger type 1 diabetes.
Type 1 diabetes causes the body to attack the beta cells of the pancreas, limiting its ability to produce the insulin necessary to regulate blood sugar levels.
In addition, the development and anatomy of the small intestine and pancreas are closely related, and the gut immune system shares connections with pancreatic lymph nodes, which have been linked to an inflammation of the pancreas and the destruction of beta cells.
The researchers, from the University of Cambridge and Barts and The London School of Medicine and Dentistry, analysed nearly 20,000 tissue samples to look for genetic similarities between the two conditions.
The key regions are thought to regulate the mechanisms that cause the body's own immune system to attack both the beta cells in the pancreas and the small intestine.
The researchers said more work was needed to pinpoint how genetic and environmental factors combined to trigger the conditions.
The researchers stressed the interaction was likely to be complex, but suggested that the same sort of environmental factors were likely to trigger both conditions.
In the paper, they write: "Our results support further evaluation of the hypothesis that cereal and gluten consumption might be an environmental factor in type 1 diabetes, leading to the alteration of the function of the gut immune system and its relationship with the pancreatic immune system."
Researcher Professor David van Heel said: "These findings suggest common mechanisms causing both coeliac and type 1 diabetes - we did not expect to see this very high degree of shared genetic risk factors."
Karen Addington, of the Juvenile Diabetes Research Foundation, which helped fund the study, "These studies demonstrate that type 1 diabetes and coeliac disease share far greater genetic overlap than had been appreciated; which helps explain the high prevalence of both conditions occurring simultaneously in an individual and may provide new avenues for understanding the cause and mechanisms of both conditions."
Sarah Sleet, of the charity Coeliac UK, described the research as a real advance in understanding a condition which is thought to do undiagnosed in many people.