NEW YORK — Consumers stepped up their shopping in May after tax rebate checks began hitting mailboxes, giving many of the nation's retailers stronger than expected sales for the month. Still, there were signs that many people are still focusing on necessities such as food and gas.

Discount and lower-priced stores such as Costco Wholesale Corp. and Wal-Mart Stores Inc. were again among the strongest performers, benefiting from a blip up in sales as consumers spent some of their rebate money.

Analysts had predicted a gloomy May, with consumers contending with rising energy costs, declining home values and tightening credit. Consumer confidence reached a 16-year low in May, the Conference Board reported late last month.

However, according to a preliminary report from Thomson Financial, of 31 retailers reporting their May sales so far on Thursday, 18 beat expectations, three met expectations and 10 missed. The tally is based on same-store sales, or sales in stores open at least a year; they are considered a key indicator of a retailer's strength.

"It certainly looks as though gas tanks didn't siphon off all of the rebate stimulus," said Ken Perkins, president of RetailMetrics LLC, a research company in Swampscott, Mass. "Consumers were able to spend in May."

"There was a big fear the $4 gallon of gas would take the lion share of stimulus spending and eat it up," he said.

As of May 30, the Treasury Department said 57.43 million payments have been sent out totaling $50.041 billion, just under half the $106.7 billion the government expects to send out.

Craig R. Johnson, president of the consultancy Customer Growth Partners in New Canaan, Conn., predicted consumers will save or pay down debt with about 60 percent of their rebate money and spend about 40 percent, providing an "overall modestly positive, but clearly positive," boost to sales continuing through the summer and back-to-school shopping season.

Retail sales have been largely disappointing since the holiday season, with lower-priced stores like Wal-Mart and Costco among the few standouts. Consumers have had to contend with ever-rising food and gasoline bills, forcing them to pay more for the basics and stopping them from buying clothing and other non-discretionary items. Worries about the ongoing housing slump and struggling economy have taken a further toll, making consumers think twice before even mildly splurging.

Even when sales showed some improvement in April and May, it was clear that consumers are still extremely cautious. And with gasoline approaching a national average of $4 a gallon and already selling over that price in many parts of the country, it's unlikely that Americans are about to embark on a spending spree.

The UBS-International Council of Shopping Centers retail sales tally for May rose 3 percent, surpassing the of 1 percent growth estimate.

Meanwhile the Labor Department reported that applications for unemployment benefits totaled 357,000 last week, some 18,000 fewer than the previous week, an unexpected improvement. However, the four-week average for people receiving benefits edged up to the highest level since March 6, 2004, when the country was still struggling to recover from a prolonged period of rising unemployment.

Wal-Mart said same-store sales rose 3.9 percent, while analysts surveyed by Thomson Financial predicted a 1.6 percent rise. Including fuel sales, same-store sales rose 4.4 percent.

Tom Schoewe, Wal-Mart's chief financial officer, told reporters Thursday that $350 million worth of tax rebate checks had been cashed in the stores so far, although he didn't know what percentage of that money was actually spent at Wal-Mart. He said the checks, along with an improvement in Wal-Mart's merchandise, helped May sales results surpass expectations.

"Our customer is clearly under pressure when it comes to higher gas prices, higher food prices for that mattter," Schoewe said.

Schoewe said he believes more customers are staying at home to save money, helping to boost sales in its home merchandise business, which had its first increase in same-stores sales in more than two years.

Rival Target Corp., which has a somewhat more upscale clientele, said same-store sales fell 0.7 percent, while analysts expected an 0.2 percent drop. Health care, electronics and perishables were the company's strongest sales categories in May, while men's apparel, jewelry, and lawn and patio sales were weakest.

Costco said same-store sales rose 9 percent, ahead of the 6.9 percent analysts were expecting. Results were boosted by food and gas sales, along with the benefit of the weaker dollar, mainly in Canada.

TJX Cos., which operates discount apparel and home furnishing stores including T.J. Maxx and Marshalls, said same-store sales rose 2 percent, edging higher than the 1.8 percent analysts expected.

Department stores reported weaker results, but many still beat analyst expectations and the luxury sector was strong.

J.C. Penney Inc. said same-store sales fell 4.4 percent, better than the 5.8 percent analysts expected. Footwear and women's accessories were strong performers, while jewelry and home categories were softer.

Luxury retailer Saks Inc. said same-store sales fell 8.7 percent, while analysts predicted a 7.5 percent drop, but that was mainly due to the shift of a clearance event into April. Combined April and May same-store sales rose 8.6 percent.

Upscale department-store operator Nordstrom Inc. reported a 10.9 percent increase in same-store sales, while analysts predicted a smaller 8.1 percent rise.

Mall-based apparel stores continued to struggle. Limited Brands Inc. said same-store sales fell 6 percent, missing the 5.5 percent drop analysts expected. The company's stores include Victoria's Secret and Bath & Body Works.

Gap Inc.'s same-store sales fell 14 percent, hurt by results from its Old Navy Stores. The result was worse than the 9.5 percent decline analysts expected.

Teen retailers, who tend to be a little more recession-proof than other apparel merchants, had mixed results.

American Eagle Outfitters Inc. said same-store sales fell 9 percent, worse than the 4.8 percent drop analysts predicted.

Aeropostale Inc. was the best performer in the teen segment, with a 6 percent rise, meeting analyst expectations, helped by positive reaction to its summer merchandise.