NEW YORK ( TheStreet) -- Office Depot ( ODP) reported a better-than-feared second-quarter loss, reducing the red ink compared with a year ago.

Investors sighed a breath of relief, and sent shares of the chain climbing 6.8% to $5.05 in pre-market trading.

During the quarter, Office Depot lost $18.7 million, or 7 cents a share, compared with a loss of $82.6 million, or 31 cents, in the year-ago period. Analysts were calling for a loss of 17 cents a share.

This overshadowed weak sales that missed expectations, as demand remained soft both domestically and internationally. Sales declined 4.3% to $2.7 billion, while same-store sales slipped 1%.

Earlier in the month, Office Depot walked away from a bid for a key Los Angeles County office supplies contract, citing "onerous" terms that would cause it to lose money on the deal.

-Reported by Jeanine Poggi in New York.

Follow TheStreet.com on Twitter and become a fan on Facebook.

More from Stocks

Market Can't Handle the Wild Ride: Cramer's 'Mad Money' Recap (Thursday 5/24/18)

Market Can't Handle the Wild Ride: Cramer's 'Mad Money' Recap (Thursday 5/24/18)

Replay: Jim Cramer on North Korea, Oil Prices, Apple and Carnival Corporation

Replay: Jim Cramer on North Korea, Oil Prices, Apple and Carnival Corporation

Canopy Growth: First Cannabis Firm on the NYSE Fails to Generate Buzz

Canopy Growth: First Cannabis Firm on the NYSE Fails to Generate Buzz

Video: This Startup Connects Buyers and Sellers of Legal Marijuana

Video: This Startup Connects Buyers and Sellers of Legal Marijuana

Dow, S&P 500 and Nasdaq Tumble After Trump Calls Off North Korea Summit

Dow, S&P 500 and Nasdaq Tumble After Trump Calls Off North Korea Summit