After suffering mightily during the early months of the COVID-19 pandemic, department stores experienced a stunning improvement in their fortunes during 2021. Many major department store chains posted earnings well above pre-pandemic levels last year.

Macy's (M -1.45%) was no exception. On Tuesday, the No. 1 U.S. department store operator posted another strong earnings report to close out its 2021 fiscal year. Management offered an optimistic outlook for 2022, as well. Let's take a look.

Sales and earnings ahead of expectations

Three months ago, Macy's posted stellar third quarter results, as adjusted earnings per share (EPS) reached $1.23: up from just $0.07 in Q3 2019. However, it issued a relatively cautious forecast for the fourth quarter. While the company projected that comparable sales would rise 2% to 4% compared to two years earlier, it estimated that adjusted EPS would fall to a range of $1.67 to $1.87, down from $2.12 in the fourth quarter of 2019.

The exterior of Macy's Manhattan flagship store.

Image source: Macy's.

Macy's easily outperformed this outlook. Comparable sales (including licensed departments) rose 6.1% relative to 2019 in the fourth quarter, driven by 36% growth in digital sales over that period.

Furthermore, the combination of stronger sales and better-than-expected cost control enabled Macy's to post adjusted EPS of $2.45. Aside from cruising past the company's guidance, this smashed the analyst consensus of $1.99.

Macy's also generated over $2 billion of free cash flow in fiscal 2021, with the vast majority of that coming in the fourth quarter. This allowed it to exit the year with $1.7 billion of cash on its balance sheet, despite reducing its debt by over $1.5 billion and buying back $500 million of stock during the year.

Tailwinds to moderate in 2022

For the first quarter of fiscal 2022, Macy's expects to post adjusted EPS between $0.77 and $0.85 on sales of $5.27 billion to $5.37 billion. This implies strong growth compared to the company's adjusted EPS of $0.39 on sales of $4.71 billion a year ago.

However, the pandemic was still weighing heavily on sales at this time last year. Macy's will face much tougher comparisons in the second quarter and beyond. Additionally, the company faces cost pressures, particularly from its decision to increase its minimum wage to $15 an hour.

As a result, looking beyond the first quarter, Macy's management anticipates that sales and earnings will retreat from the multiyear highs reached in fiscal 2021. On a full-year basis, Macy's expects sales to grow 0% to 1%. It is calling for adjusted EPS to moderate to a range of $4.13 to $4.52.

This forecast implies a double-digit EPS decline compared to the record high of $5.31 reached last year. That said, this would still mark a big improvement over fiscal 2019, when adjusted EPS totaled $2.91. Moreover, if the past year was any guide, Macy's outlook could prove to be conservative.

The exterior of a Macy's store.

Image source: Macy's.

An enticing value stock

While management expects Macy's earnings to retreat this year, it anticipates a return to growth thereafter. Macy's has lined up a slew of growth initiatives, including new store-within-store partnerships with Toys R Us and Pandora, a curated third-party marketplace on its e-commerce site, and the expansion of its small-format store fleet.

Despite ramping up investments in technology and other growth drivers, Macy's expects to generate between $3.2 billion and $3.6 billion of free cash flow over the next three years combined. It will likely return most of that cash to shareholders. This week, the company announced a 5% increase to its quarterly dividend and a new $2 billion share repurchase program.

While Macy's stock initially rallied following the earnings release, the shares ended Tuesday down 5% at $24.42. That puts its valuation at less than six times the midpoint of management's fiscal 2022 earnings guidance. At this price, Macy's looks like a very attractive value stock for long-term investors.