When is a calorie not just a calorie? When it comes to losing weight, a new study from Harvard University found that the number of calories consumed is not necessarily as important as the quality of those calories.

The kind of calories the body gets may affect how efficiently people burn their body's energy, which can be key for losing weight and keeping it off.

"It's not that calories don't matter, but the quality of the calories going in can affect the number of calories going out," said study author Dr. David Ludwig, at Boston Children's Hospital.

The researchers studied 21 overweight and obese adults, starting each on a diet that helped them lose at least 12.5 percent of their body weight. Then, to help them maintain that weight loss, the researchers put the participants on a cycle of three diets, and they were to stick to each for four weeks.

One was a low-fat diet, similar to the one recommended by the American Heart Association, which had participants reduce their dietary fat, that emphasized eating whole grains and plenty of fruits and vegetables.

Another was modeled on the Atkin's Diet, a plan in which participants ate more protein and fat but severely curbed their consumption of breads, pastas and other carbohydrates.

The final diet was a low-glycemic index plan, a model based on regulating the body's blood sugar levels used in many commercial diet plans, such as Nutrisystem and the Zone diet. The plan didn't require the participants to reduce the fat or carbohydrates in their diets but focused on the quality of the carbohydrates they ate. The plan pushed participants to replace some grain products and starchy vegetables with vegetables, legumes, fruits and foods rich in healthy fats.

The results weren't good news for low-fat diet aficionados. When dieters followed that plan, their bodies burned fewer calories than when they were following the low-carb or low-glycemic index diets. And the low-fat diet changed certain metabolic factors in their bodies that typically predicted weight regain.

The low-carb diet seemed to help participants burn the most calories. But it also increased certain markers of stress and inflammation in the body, such as the stress hormone cortisol, which are risk factors for cardiovascular disease and other health problems.

In the end, the researchers found that the low-glycemic index diet struck the right balance for the participants. It helped the dieters burn more calories, though not as many as the low-carb diet, but didn't seem to increase disease-causing stress markers in the body.

The study was published today in the Journal of the American Medical Association.

The results provide physiological evidence for a growing consensus among doctors and diet specialists: that low-fat diets, long a staple of advice for shedding pounds, aren't as beneficial as many once thought.

"There is a growing feeling that we need to go beyond low-fat diets, that was too simplistic a vision," Ludwig said. "Instead, focus on reducing highly processed carbohydrates."

Heavily processed carbohydrates - white bread, white rice and some breakfast cereals, to name a few - make sugar readily accessible, rather than securing it to more healthy elements, like the fiber in an apple. Ludwig said easily absorbable sugar leads to a rapid surge and crash in blood sugar after a meal, which can wreak havoc on weight loss.

The advice to steer clear of processed foods sounds familiar, but it hasn't always been so prominent.