Danny Johnston, Associated Press
Shanlunda Rodgers shops for school supplies at a North Little Rock, Ark., Wal-Mart store Wednesday.

NEW YORK — Shoppers, enticed by heavy discounts and armed with rebate checks, spent freely in June, helping to lift retailers' sales. The outlook for the back-to-school season remains tough, though, as consumers confront high gas and food prices, a slumping housing market and tighter credit.

The nation's retailers on Thursday reported a better-than-expected June gain of 4.3 percent, with discounter Wal-Mart Stores Inc. accounting for the majority of the gain.

Wholesale club operators BJ's Wholesale Club Inc. and Costco Wholesale Corp. were also among the best performers. Some rebate money made its way to clothing stores, like Children's Place Retail Stores Inc., though sales generally remained sluggish at mall-based clothing stores, including Limited Brands Inc. and Gap Inc.

The preliminary tally by UBS-International Council of Shopping Centers beat projections for a 2 percent to 3 percent gain, according to Michael P. Niemira, chief economist at ICSC.

However, excluding Wal-Mart's robust gain, the sales tally was up 1.9 percent, though it was slightly better than the 1.1 percent average seen so far this fiscal year, which for retailers begins in February.

The results come on top of a better-than-expected 2.9 percent gain in May as the rebate checks

began arriving. The tally is based on same-store sales, or sales at stores opened at least a year, and are considered a key indicator of a retailer's health.

Ken Perkins, president of RetailMetrics LLC, a research company in Swampscott, Mass., said the rebate checks provide only a "one-time bump." "The back-to-school season is going to be challenging," he said.

June, the second-most-important month in a retailer's sales calendar, is a time when merchants clear out summer goods to make room for back-to-school merchandise. Customers found some good deals.

Merchants appear to be more aggressive about discounts than last year as fears about the economy have dragged consumer confidence to the lowest level in 40 years. Barneys New York is offering up to 75 percent off on designer merchandise, while Banana Republic has discounts of up to 60 percent.

Perkins said the discounts have generally been planned well in advance and stores have been prudent about keeping lean inventory, so second-quarter earnings results shouldn't be a disaster.

But they are likely to be weaker. Perkins estimated that second-quarter profits for the 130 companies he tracks are expected to be down 5.6 percent, compared to the 6 percent increase expected at the beginning of the year.

"People are being way more picky" about clothing purchases, said analyst Jennifer Black.

Shoppers are also trading down to less-expensive stores, benefiting Wal-Mart and other low-price operators. Wal-Mart reported a robust 5.8 percent gain in same-store sales, saying economic stimulus checks helped lift overall customer traffic. The results exclude fuel sales. Analysts polled by Thomson Financial expected an increase of 3.8 percent.

The world's largest retailer noted strong gains in grocery, entertainment and health and wellness items and added that warmer weather helped sales in such categories as apparel and toys. It also cited strong sales of flat-panel TVs, underscoring the trend of people staying home more.

The discounter raised its earnings outlook, but cautioned that "consumers and small business owners remain concerned about the economy, inflation and most of all, higher gas prices." With the last large mailing of economic stimulus checks due this Friday, Wal-Mart said it's difficult to forecast the benefit from the economic stimulus checks through the remainder of the year.

Target Corp., which has not fared as well as Wal-Mart in recent months, reported a 0.4 percent gain in same-store sales. The results were better than the 0.5 percent decline that analysts had expected.

Costco reported a strong 9 percent gain in same-store sales, surpassing the 8.2 percent estimate from Wall Street.

BJ's said its June same-store sales soared 16.5 percent, topping analyst expectations, as sales of both merchandise and gasoline rose sharply. Analysts had expected a 10.9 percent gain.

Among department stores, J.C. Penney Co. posted a 2.4 percent decline in same-store sales in June, a bigger drop than the 1.1 percent decline that analysts had expected.

The women's division was the strongest category for the month, while jewelry and home divisions were weak.

Upscale Nordstrom Inc. reported an 18.6 percent decline in same-store sales, matching analysts' estimates, and warned it may not meet its second-quarter earnings forecast. It blamed higher markdowns and the shift of its spring merchandise clearance sale for women and children into May

Some clothing chains appeared to get some relief from the rebate money.

Children's Place Retail Stores Inc. said same-stores sales rose 16 percent in June, more than double analysts' estimates. Wall Street had expected same-store sales to rise 7.8 percent.

But Limited posted a 9 percent decline in same-store sales, worse than the 7.4 percent decline that analysts had expected.

Gap reported a 7 percent decline in same-store sales, though the results were better than the 11.6 percent decrease that Wall Street had expected.

Wet Seal Inc. had a 2.9 percent decrease in same-store sales, in line with the 3.0 percent drop that analysts had predicted.