Major retailers, led by discounters Wal-Mart Stores and Target Corp, turned in better-than-expected August sales on Thursday, as consumers went back-to-school shopping despite higher gas prices and the nation's housing meltdown.

Retail leader Wal-Mart Stores Inc posted a 3.1 percent same-store sales rise for August as it aggressively cut prices on school supplies to entice shoppers. Analysts were expecting its U.S. sales to rise 1.6 percent, according to Reuters Estimates.

Other chains posting stronger-than-expected results included Target Corp, AnnTaylor Stores, Gap Inc and J.C. Penney, which reported a lower-than-expected sales decline on Wednesday.

While the August numbers were better than expected on the whole, one analyst cautioned that sales in the month following disappointing July results, were not an indication that consumer spending would remain robust through autumn and into the holiday season.

Consumers face many pressures as weakness in the housing market grips the wider economy and high gasoline prices keep some shoppers away from malls.

We don't think this really signals a trend where retailers are going to come in and beat expectations by a wide margin and generate particularly strong comps through the fall, said Ken Perkins, president of Retail Metrics, which tracks sales.

Perkins said 64 percent of retailers beat expectations for the month.

Even Macy's Inc, which has struggled with disappointing results at former May Department Stores it acquired in 2005, topped expectations with a 2.4 percent same-store sales rise as it increased promotions.

Teen retailers had solid results as shoppers scooped up jeans and other trendy clothing before heading back to school.

Later back-to-school starts in Texas and Florida have given a lot of retailers a nice boost, coupled with tax-free events that got pushed out of July into August this year, Perkins said.

But Aeropostale Inc disappointed with a 1.7 percent rise in August sales, shy of the 2.5 percent increase analysts had expected.

The luxury sector continued its strong run as Saks Inc reported a same-store sales jump of 18.2 percent on demand for designer clothing and shoes -- double the 9.1 percent increase expected by analysts. Nordstrom's August comparable-store sales gained 6.6 percent.