Count me among those standing in shock and awe at Sears Holdings' (NASDAQ:SHLD) surprise profit for the first quarter. The market was no less surprised, opening shares at 21% higher than yesterday's close.

The distressed retailer was able to post earnings of $47 million after excluding numerous one-time items on revenue of $10.1 billion. Analysts had pegged the company's sales number correctly, but they were way off on profit. They expected it to record yet another quarterly loss, this time at $0.88 per share.

Lest you think Eddie Lampert has Sears Holdings moving in the right direction, however, consider that total sales were still down 9% from last year. The company also maintained its unenviable string of declining annual same-store sales, a record that goes back to at least 2005. Comps once again fell by a frightening 7.4% in the first quarter.

There were improvements, to be sure. Inventory was reduced to $9.5 billion from $10.3 billion in the year-ago period, and the company was able to cut its debt by half a billion dollars, to $3 billion. By better managing its inventory, Sears Holdings was able to raise its gross margins 130 basis points, despite the faltering sales.

Sears Holdings might have enjoyed a brief respite from the bad news because of the demise of Circuit City. The company said that, whereas apparel continued to be a blight on sales, home electronics showed surprising strength in domestic stores. Industry leader Best Buy (NYSE:BBY) was also able to beat analysts' earnings expectations this past quarter and further expand its market share because it had one less rival to contend with. Nevertheless, the Commerce Department reported that sales at electronics and appliances stores fell 2.8% in April. The closing of Circuit City seemed to have depressed sales in this segment, as consumers went bargain-hunting.

Wal-Mart (NYSE:WMT), of course, is the biggest beneficiary of consumers' migration to cheaper stores, and it is expanding its electronics offerings to take advantage of the influx. Sears Holdings' stores have been losing market share to Wal-Mart and Target (NYSE:TGT), although the latter -- which generates more than 40% of its revenue from non-essentials such as home goods and clothing -- found itself in a similar position as Sears Holdings, and it watched comps fall 3.7% in the quarter.

Sears Holdings ought to read into those numbers and make some kind of effort to keep what customers it did attract coming back for more. Lampert thinks consumers rank his Sears stores between Target and Macy's (NYSE:M), though some thoughtful Fools would peg it significantly below either of them.

Also important to the retailer, however, was its ability to renegotiate a credit agreement with Bank of America (NYSE:BAC). The lender, extending part of the original agreement that was set to expire in March out until 2012, provided Sears Holdings an additional $1 billion next year if it needs the cash.

Not having the necessary credit to purchase merchandise was an ongoing source of concern for investors and analysts, and the new agreement alleviates much of that worry. What has not changed is the anxiety they face over the company's inability to attract more customers to its stores. It's great that they've received credit to buy merchandise, but if no one is willing to buy it, then all the funding in the world doesn't really matter.

The quarterly profit was a surprise, no doubt. It will be even more surprising, though, whether Sears Holdings can repeat the effort next time around.

Sears Holdings, Best Buy, and Wal-Mart Stores are Motley Fool Inside Value recommendations. Best Buy is a Stock Advisor selection, and the Fool owns shares of it. Try any of our Foolish newsletter services free for 30 days.

Fool contributor Rich Duprey owns shares of Wal-Mart but has no financial position in any of the other stocks mentioned in this article. You can see his holdings. The Motley Fool has a disclosure policy.