Eating sugary foods, researchers have found, increases the risk of dying from heart disease.

Researchers analyzed data from a nationally representative sample of 31,147 adults, gathered in a larger 20-year study of health and mortality. The study was posted online in JAMA Internal Medicine.

All participants received physical examinations and responded to a food questionnaire. The scientists calculated “added sugar”— that is, all sugar not found naturally in fruits and fruit juices, but instead in sugar-sweetened beverages, dairy desserts, candy, cakes and other foods — as a percentage of total calorie intake.

Most adults, they found, get 10 percent or more of their calories from added sugar. After adjusting for age, smoking, sex, B.M.I., physical activity and other factors, they found that compared with people whose calories were less than 10 percent from added sugar, those whose intake was 10 to 25 percent added sugar had a 30 percent increased risk of cardiovascular death. Those whose diet was more than 25 percent added sugar almost tripled their risk.

“Cardiovascular disease is the leading cause of death in the U.S.,” said the lead author, Quanhe Yang, an epidemiologist with the Centers for Disease Control and Prevention. “Sugar intake is a modifiable risk factor and most of us eat too much of it. Our results support the current recommendation to limit the intake of added sugar.”