By JON SPRINGER

Supermarket operators had their top lines tickled — and their nerves tested — when inflation returned in 2011.

With prices up an estimated 4% to 5% for the year, inflation was a friend to many retailers at least until fears of a more sluggish economy made some retailers balk at passing all their costs along and/or invest in lower prices.

Particularly early in the year, retailers said they were doing their best to pass along their higher costs to consumers and were helped along by what they described as rational behavior among competitors. This resulted in a tailwind for sales from retailers that began with Wal-Mart Stores and continued up the line, analysts said.

“We’ve gotten tremendous pass-through of price increases,” John Heinbockel, managing director of Guggenheim Securities, said during SN’s annual financial analyst roundtable this summer. “Wal-Mart has led the charge, and others have followed.”

Mike Schlotman, Kroger’s chief financial officer, during a conference in May said retailers had generally been conscious of protecting margins and were engaging in fewer money-losing promotions to lure shoppers. “I would say that kind of activity is dramatically more rational today than it has been for the last three or four years.”

But as the year wore on, the balancing act appeared to get trickier. Kroger said it had to invest heavily in price to maintain volumes during the summer when consumers were spooked by rising prices.

“A good acrobat can ride the tightrope for a while, but eventually, they’ll fall, especially if the wind gets stiffer from the economy and food inflation,” Gary Giblen, an analyst for Aegis Capital, said regarding Kroger’s second-quarter results, which were announced in September. “This time, they couldn’t get the right balance.”

Delhaize’s Food Lion reported similar troubles passing along increases in some Southeast markets. “We’ve attempted to pass along as much of the cost inflation as we could, but we simply are not able to do that in all markets,” Ron Hodge, executive vice president, confessed during a quarterly conference call in November.

As the year ended retailers reported that some of the fast-rising prices of the first half of the year had stabilized, leading to hope that modest inflation would provide a gentler ride in 2012.