NEW YORK – Over the long term, a low-carb diet works just as well as a low-fat diet at taking off the pounds — and it might be better for your heart, new research suggests.

Both diets improved cholesterol in a two-year study that included intensive group counseling. But those on the low-carbohydrate diet got a bigger boost in their so-called good cholesterol, nearly twice as much as those on low-fat regimens.

In previous studies, low-carb diets have done better at weight loss at six months, but longer-term results have been mixed. And there’s been a suggestion of better cholesterol from low-carb eating.

The latest test is one of the longest to compare the approaches. At the end of two years, average weight loss was the same for both — about 15 pounds or 7 percent.

The key difference was in HDL, or good cholesterol: a 23 percent increase from low-carb dieting compared to a 12 percent improvement from low-fat, said Gary Foster, director of Temple University’s Center for Obesity Research and Education, who led the federally funded study.

Foster said the low-carb boost is the kind one might get from medicines that improve HDL. “For a diet, that’s pretty impressive,” he said.

The findings, published in today’s Annals of Internal Medicine, are based on a study of 307 adults, two-thirds of them women. Participants were obese but didn’t have cholesterol problems or diabetes.

Half followed a low-carb diet modeled after the Atkins plan, and half went on a low-calorie, low-fat diet. All attended group sessions to help them change bad eating habits, get more active and stick to their diets.

The volunteers had periodic checks of their weight, blood, bone density and body composition. After two years, there were no major differences between diet groups, except in good cholesterol.

Why the low-carb diet had a bigger effect on good cholesterol isn’t known, the researchers said.