We experience heartburn when stomach acid or bile flows into the food pipe — esophagus — and irritates its lining, sometimes causing a burning pain in the chest that feels like a heart attack. The symptoms of heartburn or acid reflux usually occur after eating and get worse if someone is lying down.

When these symptoms occur regularly and twice a week or more, they are diagnosed as gastro-esophageal reflux disorder, or GERD. GERD can cause sore throats and hoarseness. Like heartburn, it may literally leave a bad taste in your mouth.

Millions of people take proton pump inhibitors, or PPIs, to relieve the symptoms of acid reflux, peptic ulcers and indigestion. PPIs are effective and they are among the most commonly used drugs worldwide. They also have a range of serious side effects.

The long-term use of PPIs has already been linked to an increased risk of bone fractures, liver disease, chronic kidney disease, gut infections and stomach cancer. Now a study finds that they may also raise a person’s risk of type 2 diabetes.

Changes in the type and volume of bacteria in the microbes living in the gut may be what is behind the connection between the use of PPIs and the increased risk of developing diabetes.

Chinese and American researchers wondered if the widespread use of PPIs and rising prevalence of diabetes worldwide might be connected. They looked at the health records of over 200,000 people involved in U.S. Nurses' Health Study (NHS), the NHS II and the Health Professionals Follow-up Study (HPFS).

Study participants provided information on their health behaviors, medical history and newly diagnosed conditions when they enrolled and every two years after that. Participants were also asked whether they had used PPIs two or more times a week in the preceding two years.

The researchers tracked study members for 9 to 12 years, during which time over 10,000 of them were diagnosed with type 2 diabetes. The risk of a diabetes diagnosis among those who used PPIs regularly was about 7.5 per 1000. The risk of type 2 diabetes was only about 4.3 per 1000 among those who didn't use PPIs.

The longer a person was on PPIs, the more the risk grew, the team, from Sun Yat-Sen University, Harvard Medical School and the Chinese University of Hong Kong, found. If someone used PPIs for up to two years, it was associated with a five percent increased risk. Using proton pump inhibitors for more than two years was associated with a 26 percent increased risk.

A person's risk of diabetes fell as the amount of time that had elapsed since stopping the drugs increased.

Even when factors that might also influence the development of type 2 diabetes — such as high blood pressure, high cholesterol, physical inactivity and use of other medications — were considered, patients who regularly used PPIs were still 24 percent more likely to develop type 2 diabetes.

Researchers also monitored the impact of H2 blockers, another type of drug used to curb excess stomach acid production, for comparison. They found it was associated with a 14 percent increased risk of type 2 diabetes. Just as with PPIs, its longer-term use was also associated with a higher risk; and a longer time since stopping was associated with a lower risk.

Previous studies have shown that PPI use reduces diversity of gut microbiome. Changes in the type and volume of bacteria in the microbes living in the gut may be what is behind the connection between the use of PPIs and the increased risk of developing diabetes, the researchers say. Patients who need long-term PPI treatment, they suggest, should be routinely screened for abnormal blood glucose and type 2 diabetes.

In many cases, acid reflux can be managed without the need for drugs. Eating smaller meals more frequently, eating slowly, remaining upright after eating, cutting back on coffee and alcohol, and avoiding carbonated beverages can all help reduce it.

The study is published in Gut.