(Reuters) - Macy's Inc M.N raised its annual earnings forecast on Wednesday, signaling a strong holiday shopping season ahead, encouraged by good performance at its stores and its growing online business.

FILE PHOTO: The Macy's logo is pictured on the side of a building in down town Los Angeles, California, U.S., March 6, 2017. REUTERS/Mike Blake/File Photo

The largest U.S. department store chain, which has closed more than 100 locations and cut thousands of jobs since 2015, also reported much better than expected profit and sales for the third quarter, boosted by double-digit growth at its online shopping service.

Like many other major U.S. retail names, Macy’s has been struggling with plummeting mall traffic and a defection of customers to a new range of online and fast-fashion stores.

In response, the 160-year old company has invested heavily in its off-price Backstage stores, loyalty program, mobile app and website, while improving brick-and-mortar stores by equipping them with mobile checkouts and new shop layouts.

Shares in the company rose as much as 4 percent in early trade, but later gave up those gains. They last traded down 2.4 percent at $34.94. They are still up about 40 percent this year.

“I would characterize the quarter as solid but not great,” said research firm Retail Metrics founder Ken Perkins. “Strong economic growth coupled with low unemployment should be driving strong sales across retail.”

Chief Executive Jeffrey Gennette said the Cincinnati, Ohio-based retailer was so encouraged by the expansion of its Backstage discount stores, which sell excess and off-season inventory at steep discounts, it would invest more marketing dollars toward the initiative.

The company expects the additional marketing, which launched last month, to increase awareness of Backstage and bring new customers into the store, Gennette said.

Sales from Macy’s stores and third-party licensees open for more than 12 months rose 3.3 percent, the fourth consecutive quarterly increase. That topped analysts’ average estimate of a 2.82 percent increase, according to IBES data from Refinitiv.

Macy’s now expects adjusted earnings of between $4.10 and $4.30 per share in fiscal year 2018, compared with an earlier forecast of $3.95 to $4.15 per share.

The owner of the Macy’s and Bloomingdale’s chains said net income attributable to shareholders rose to $62 million in the third quarter from $30 million a year earlier.

Excluding one-time items, Macy’s earned 27 cents per share, nearly double analysts’ average estimate of 14 cents. Net sales rose 2.3 percent to $5.40 billion, matching expectations.