Office Depot ( ODP) surprised investors Tuesday, posting a smaller-than-expected loss in the first quarter.

This unforseen upside sent shares climbing 18% in afternoon trading to $2.97.

The office supplier reported a loss of $55 million, or 20 cents a share, compared with a profit $69 million, or 25 cents, last year.

Excluding charges for restructuring, which included facility closings, the company reported earnings of 10 cents a share. Analysts were expecting a loss of 10 cents.

Sales declined 19% to $3.2 billion, as cash-strapped consumers and small businesses cut back on purchasing big-ticket items like furniture and computers. Office Depot said its decision to cut back on advertising promotions also hurt sales.

Inventory per store was lowered 27% in the first quarter in an effort to generate cash flow. During the quarter Office Depot also shuttered 107 stores, leaving the company with 1,600 locations worldwide.

Last month rival Staples ( SPLS) also suspended opening new North America stores after reporting a 14% decline in fourth-quarter profit.

While Office Depot appears to have sufficient liquidity to weather the storm, an analyst at J.P. Morgan announced today that it will become increasingly difficult to drive cash flow using its balance sheet as the year progresses.
Copyright 2009 TheStreet.com Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed. AP contributed to this report.