Wal-Mart Stores Inc. had its first quarterly sales increase in more than two years, saying efforts to avoid passing rising food costs to consumers fueled ongoing strength in the grocery department.

The retailer’s grocery business continued its positive trend during the past quarter, Bill Simon, chief executive of Wal-Mart’s U.S. operations, said during a recorded conference call released Nov. 15 along with quarterly financial results.

Rising food costs continue to be a major concern for customers, Simon said. Wal-Mart is absorbing some of the cost increases in fresh produce, meat and other products as the company aims to “ensure price leadership” in the retail food market, he said.

“We hear from some shoppers that they believe it will be more difficult than ever to afford holiday meals for their families,” Simon said. “We understand their concern, and we see it every month in our customers’ purchasing behavior.

“Some customers make difficult decisions to trade down to lower price points, or trade out of certain categories completely.”

Wal-Mart’s comparable-store grocery sales rose by low single-digits in percentage terms during the quarter, compared with the same period a year earlier, Simon said. The retailer’s food costs rose 4%, in line with inflation across the industry, Simon said.

“But given our price investment, the impact to our customers was substantially less,” he said.

The results illustrate Wal-Mart’s continued emphasis on fruits, vegetables and other fresh foods after the world’s biggest retailer added grocery departments to most of its approximately 3,800 U.S. stores over the past few years. More recently, Wal-Mart expanded in large cities such as Chicago with smaller stores that also offer fresh foods.

Wal-Mart’s overall sales sagged as the economy recovered slowly from the recession, and consumers, squeezed by high unemployment and rising gasoline prices, sought bargains at dollar stores and other discounters.

But Wal-Mart’s sales slump appears to be reversing sooner than expected, according to the Bentonville, Ark.-based company.

Overall, comparable U.S. store sales excluding fuel rose 1.3% percent during the 13 weeks ending Oct. 28 compared with the same period a year earlier, Wal-Mart said. Prior to the most-recent quarter, Wal-Mart posted nine consecutive quarterly year-over-year sales declines.

Comparable store sales are a widely-followed measure of retailer performance and typically reflect locations open at least a year.

The soft economy continued to weigh on customers, Wal-Mart said, and the company’s quarterly profit declined nearly 3%.

“Economic conditions in the third quarter remained largely unchanged,” Simon said. “Our core customer was still impacted by high unemployment and continued uncertainty over the economy, leading to declining consumer confidence.”

During the three months ended Oct. 28, Wal-Mart’s fiscal 2012 third quarter, net income fell to $3.34 billion from $3.44 billion a year earlier, according to a company statement. Total revenue rose 8.1% to $110.2 billion.

Including the Sam’s Clubs warehouse chain, Wal-Mart sells more food in the U.S. than the country’s three largest traditional supermarket chains — Kroger Co., Safeway, Inc., and Supervalu Inc. — combined. In the 12 months ended January 31, groceries accounted for 54% of Wal-Mart’s U.S. sales, or nearly $141 billion, according to a company filing.