Wal-Mart Stores Inc said same-store sales at its U.S. discount chain rose in July, as a renewed emphasis on offering low prices on a wide assortment of goods started to stem more than two years of quarterly sales declines.

Wal-Mart's comments and better than expected quarterly results that it also reported on Tuesday sent its shares over 4 percent higher. The world's largest retailer, with nearly 9,700 stores, stressed its commitment to pricing products below its competitors and emphasizing that promise to shoppers.

Walmart discount stores account for nearly 11 percent of U.S. retail sales. More of its shoppers are relying on government aid to help them pay for food and other necessities, are shopping less often to save money on gasoline and are spending less when paychecks run out, showing that the low- and middle-class Americans to which chains such as Walmart cater clearly remain under pressure.

Recent analyst reports have suggested that competitors have closed the price gap with Walmart in areas such as food.

The vast majority of people who shop at Walmart no longer believe that Walmart is the lowest-priced on most things, said Wendy Liebmann, CEO of WSL/Strategic Retail, citing her firm's April survey of Walmart shoppers.

While Walmart U.S. same-store sales fell 0.9 percent in the quarter that ran from May through July, that measure rose in July and the company still expects it to rise on a quarterly basis at some point this year, Walmart U.S. Chief Executive Officer Bill Simon said.

It seems like they're going to kind of ramp up that pressure on lowering price, said ITG Investment Research analyst John Tomlinson.

Wal-Mart posted larger-than-anticipated increases in quarterly profit and sales, helped by its Sam's Club warehouse and international chains such as Britain's Asda.

Still, the United States remains its biggest market, accounting for 62.1 percent of the $419 billion in sales last year, and many of Walmart's U.S. customers are struggling.

They're trading down to stretch their budgets -- buying a lower-priced brand of detergent, moving from branded canned goods to private label and purchasing half gallons of milk instead of gallons, Wal-Mart Chief Executive Mike Duke said during a recorded call.

MORE GOVERNMENT ASSISTANCE

U.S. shoppers' biggest economic concerns are job security, the rising cost of food and the high price of gasoline, Chief Financial Officer Charles Holley told reporters.

The number of shoppers relying on government aid has risen over the last 2-1/2 years, Holley said, noting that unemployment levels have been higher for people who had less education and less income to begin with.

Sales at Wal-Mart's U.S. discount stores open at least a year, excluding fuel, have now fallen for nine straight quarters. (Graphic on U.S. Walmart same-store sales: http://r.reuters.com/bad33s)

The second quarter's decline was near the low end of Wal-Mart's forecast of down 1 percent to up 1 percent. Analysts on average had expected a decline of 0.6 percent, according to Thomson Reuters data.

Even though Walmart's U.S. same-store sales were worse than those of competitors such as Target Corp, dollar stores and warehouse chains, Walmart gained momentum, said Wall Street Strategies analyst Brian Sozzi, who upgraded the shares to hold from sell.

Wal-Mart said U.S. same-store sales improved each month during the quarter. Fewer customers visited the stores, but those who shopped spent more on average.

Wal-Mart appears to be taking the right steps, including pricing changes, growing its international business and opening more smaller stores. But the stock may be too pricey for some as it is hard to see substantial changes in such a large company, said Larry Carroll, president of Carroll Financial, based in Charlotte, North Carolina.

I'm neutral on it, and if it were 10 or 15 percent cheaper, I'd be inclined to buy it, said Carroll, who has owned Wal-Mart in the past.

Shares were up $2.41 at $52.39 in afternoon trading. Shares of Home Depot Inc, which also reported better-than-expected quarterly results, climbed as well.

Wal-Mart earned $1.09 per share from continuing operations in the second quarter ended July 31, up from 97 cents a year earlier and near the high end of its forecast. Excluding items, earnings were $1.12, compared with the average analyst estimate of $1.08, according to Thomson Reuters I/B/E/S. Sales rose 5.5 percent to $108.64 billion.

The company raised its fiscal year profit forecast and said Walmart U.S. same-store sales should be down 1 percent to up 1 percent in the current third quarter.

(Reporting by Jessica Wohl and Brad Dorfman. Editing by Robert MacMillan and Gerald E. McCormick)