A diet based on healthy carbohydrates—rather than a low-fat or low-carbohydrate diet—offers the best chance of keeping weight off without bringing unwanted side effects, a study published Tuesday in the Journal of the American Medical Association suggests.

Study participants following a low-glycemic-index diet, which is similar to a Mediterranean diet and focuses on fish, fruit, vegetables, nuts and whole grains, also saw improved cholesterol levels and other important markers that lower the risks of developing heart disease and diabetes. Such a diet might include minimally processed oatmeal, almonds, brown rice, beans and healthy fats like olive oil, among other foods.

The study was led by researchers at the New Balance Foundation Obesity Prevention Center at Boston Children's Hospital and funded by the National Institutes of Health and the New Balance Foundation, which is affiliated with the athletic-shoe maker. It was designed to assess how each of three common diets affects the ability to keep weight off. Participants had all of their food prepared for them, and their food intake was monitored. They ate many meals at the hospital, picking up others to eat at home.

David Ludwig, one of the study's authors and the director of the center, explained that most people struggle to keep weight off. Previous studies have shown that weight loss reduces the body's daily energy expenditure—or how many calories the body burns through activity and just by resting—making it easy to regain weight. Dr. Ludwig's study was designed to look at the impact of the three diets on measures of energy expenditure, in addition to assessing hormones, fat levels in the blood and other health markers.

The study's 21 participants, 18 to 40 years old, initially lost 10% to 15% of their body weight during a three-month diet that contained about 45% of total calories from carbohydrates, 30% from fat and 25% from protein.