Macy’s digital transformation and corporate turnaround efforts are finally paying dividends. The department store giant reported earnings for the holiday quarter that handily topped Wall Street expectations and gave Macy’s its first same-store sales growth in three years.

The Cincinnati-based retailer said it had Q4 earnings of $2.82 a share on revenue of $8.67 billion, up 1.8 percent. Analysts had expected profit of $2.71 a share and revenue of $8.68 billion. Shares of Macy’s were up as much as nine percent following the report.

Sales at Macy’s stores open more than 12 months, including in departments licensed to third parties, climbed 1.4 percent over the quarter, topping analyst estimates for a 0.31 percent increase.

“We are encouraged to see a trend improvement in our brick & mortar business, and we had the 34th consecutive quarter of double-digit growth in our digital business,” said Macy’s CEO Jeff Gennette.

Macy’s said it plans to spend $1.05 billion on capital expenditures this year to bolster its stores and e-commerce strategy. The retailer is also finding ways to capitalize on its remaining real estate assets to strengthen its e-commerce business. Over the past three years Macy’s has brought in $1.3 billion by shedding underperforming stores, and selling unused warehouses and parking garages.

In February, Macy’s signed an agreement to sell seven floors in its Chicago flagship to a private real estate fund sponsored by Brookfield Asset Management. Brookfield plans to convert the unused floors into office space, while…