Wal-Mart Stores Inc's decision to absorb most of the rising food costs for its stressed U.S. shoppers and spend on its e-commerce business weighed on profitability, even as key U.S. sales rose for the first time in more than two years.

Sales at U.S. discount stores open at least a year rose more than expected in the third quarter ended on October 31, ending a string of nine straight quarterly declines. Same-store sales have now risen for four months in a row.

But visits to stores were once again down from a year earlier, even as shoppers, on average, spent more per visit.

Walmart U.S., the largest division of the world's largest retailer, held off on raising prices as much as it could to appeal to cost-conscious shoppers who remain concerned about the job market and overall economy.

They were clearly being aggressive in pricing and gaining share, but they didn't get the leverage on the cost side, said ITG Investment Research analyst John Tomlinson. He said the company might look for more price givebacks from vendors.

Groceries cost Walmart U.S. about 4 percent more during the quarter. But the company only saw inflation of 0.7 percent across the entire store due to deflation in areas such as televisions, price cuts and customers trading down to less expensive options, said Walmart U.S. Chief Executive Officer Bill Simon.

Shares of Wal-Mart were off 1.9 percent at $57.80 in early trading on Tuesday.

The shares had been rising heading into the quarterly report, after Wal-Mart said in mid-October that U.S. same-store sales had continued to rise early in the period.

Same-store sales account for about 98 percent of Wal-Mart's sales in the United States, so ending the slump at existing stores is critical for the company, whose international business has not grown as rapidly as some anticipated.

Walmart customers remain worried about the U.S. job market, CEO Mike Duke said on a recorded call. The company's survey of mothers found that only one out of 10 viewed the economy as good, he said.

Sales momentum at Walmart U.S. and the Sam's Club warehouse chain position the company exceedingly well for the holidays, Duke said.

The company's efforts are coming at a cost. Unallocated corporate overhead and other expenses jumped about 40.7 percent to $536 million (338 million pounds), due largely to Wal-Mart's investment in e-commerce, Treasurer Jeff Davis said on the call.

U.S. TURNAROUND

Sales at U.S. discount stores open at least a year rose 1.3 percent. That topped the company's forecast, which called for such sales, excluding fuel, to be down 1 percent to up 1 percent. It also exceeded the analysts' average forecast for a rise of 0.3 percent, according to Thomson Reuters data.

Walmart is offering holiday season layaway for the first time in years and is advertising its low prices more than usual as it tries to win back shoppers that have flocked to competitors such as Dollar General Corp.

The most popular toy on layaway so far has been LeapFrog Enterprises Inc's LeapPad, Simon said. The gadget, which is like a tablet computer for kids, is priced at about $99.

Retailers account for a layaway sale when the customer pays for the item in full and picks it up, so many items that shoppers put on hold at the end of the third quarter will not count as sales until the fourth quarter.

Walmart, which has been open on Thanksgiving for years, will start its big sales at 10 p.m. that night. It has also lowered some prices weeks before Black Friday, the day after Thanksgiving and the traditional kick-off to the holiday shopping season.

Wal-Mart earned $3.34 billion, or 97 cents per share, from continuing operations in the third quarter, compared with $3.44 billion, or 95 cents per share, a year earlier. There were fewer shares outstanding during the most recent quarter.

The company had forecast a profit of 95 cents to $1.00 per share. Analysts on average expected 98 cents, according to Thomson Reuters I/B/E/S.

Net sales rose 8.2 percent to $109.5 billion.

Wal-Mart forecast fourth-quarter earnings of $1.42 to $1.48 per share from continuing operations, up from $1.41 a year earlier. Analysts on average forecast $1.45.

For the fourth quarter, the company expects Walmart U.S. same-store sales to be flat to up 2 percent. Such sales fell 1.8 percent a year earlier.

At Sam's Club, Wal-Mart expects same-store sales, excluding fuel, to rise 4 percent to 6 percent. Last year, that unit posted a 2.7 percent rise.

(Reporting by Jessica Wohl in Chicago; Editing by Lisa Von Ahn and John Wallace)