People hoping to lose weight with exercise often wind up being their own worst enemies, according to the latest, large-scale study of workouts, weight loss and their frustrating interaction.

The study, which tracked how much people ate and moved after starting to exercise, found that many of them failed to lose any weight — or even gained some — while exercising, because they also reflexively changed their lives in other ways. But a few people in the study did drop pounds, and their success could have lessons for the rest of us.

Physical activity consumes calories, and, common sense would have us believe, causes us to utilize our internal energy stores, which most of us would call our flab, and shed weight. But common sense has never translated well to bathroom scales.

Studies have shown that most men and women who begin new exercise routines drop only about a third as much weight as would be expected, given how many additional calories they are expending with exercise.

So, for the new study, which was published in the American Journal of Clinical Nutrition, researchers with the Pennington Biomedical Research Center in Baton Rouge, La., exhorted a group of inactive people into exercising and closely tracked how their waistlines and daily habits changed.

They began by recruiting 171 sedentary, overweight men and women ages 18 to 65, measured their weight, resting metabolic rates, typical levels of hunger, aerobic fitness and, using complex, liquid energy tracers, daily food intake and energy expenditure.

They then randomly assigned some to continue their normal lives as a control group, while others began supervised exercise programs. In one, people exercised three times a week on treadmills or exercise bikes until they had burned 8 calories for every kilogram (2.2 pounds) of their body weight, or about 700 calories a week for most of them. The other program upped the exercise to 20 calories for every kilogram of body weight, or about 1,760 calories a week.

Six months later, as expected, the control group’s numbers had not budged. But neither had those of most of the exercisers. A few had dropped pounds, but about two-thirds of those in the shorter-workout group and 90% of those in the longer-workout group had lost less weight than would have been expected.

They had compensated for their extra calorie burn by eating more, other measurements and calculations showed. The extra calories were slight — about 90 additional calories each day for the some-exercise group, and 125 a day for the most-exercise set. But this noshing was sufficient to undercut weight loss.

“In effect, they felt that it’s OK to trade behaviors,” said Timothy Church, an adjunct professor at Pennington who led the new study. “It’s the ‘if I jog now, I deserve that doughnut later’ idea.”

The bottom line: People hoping to lose weight with exercise should skip the self-congratulatory treat afterward, no matter how small it might seem.