Shares of OfficeMax (OMX) soared Tuesday despite reporting softer sales and swinging to a second-quarter loss over a year-earlier profit as its results beat expectations.

The news came just after bigger rival Office Depot (ODP) reported a smaller-than-expected quarterly loss, a sign that the office supplies industry make be on the brink of a rebound.

The Naperville, Ill.-based seller of business-to-business and retail office products posted a net loss of $3.02 million, or 4 cents a share, compared with a year-ago profit of $11.8 million, or 14 cents a share, in the same quarter last year.

Excluding one-time items, the third-biggest office supply chain earned $6 million, or 7 cents a share, ahead of average analyst estimates in a Thomson Reuters poll of break-even earnings per share.

Revenue for the three months ended June 25 was $1.65 billion, virtually matching last years results and the Streets view. Those results were impacted by flat segment sales of $880.3 million and a decrease of 0.5% in same-store sales.

We continued to experience top line softness as a result of the difficult macroeconomic environment but have made progress on gross margin initiatives, OfficeMax CEO Ravi Saligram said in a statement. We remain focused on executing the fundamentals better, enhancing the management team and improving the operations of the business.

Looking ahead, the company said sales trends remain soft but it continues to tightly manage expenses. OfficeMax stood by its third-quarter guidance.

Shares of Staples (SPLS), the biggest player in the sector, were moving higher.

Follow Jennifer Booton on Twitter at @Jbooton