During the past five years or so, Best Buy (NYSE:BBY) has made a remarkable comeback, following several years of weak sales and margin compression. That said, while the company stabilized itself, it didn't offer investors meaningful growth -- until now.

However, Best Buy posted stellar results for the fourth quarter of fiscal 2018, ending a strong year with its best quarterly performance yet. Management is enthusiastic about Best Buy's chances of continuing its sales and earnings growth in fiscal 2019 and beyond. Nevertheless, investors should be cautious about buying Best Buy shares now, as the stock has posted huge gains in the past year, and competition will remain intense in the long run.

Best Buy delivers a blowout quarter

Entering the fourth quarter, Best Buy's management had fairly modest expectations. The company's guidance called for comp sales to rise 1%-3%, with adjusted earnings per share roughly flat on a year-over-year basis at $1.89-$1.99.

However, Best Buy blew past that forecast. Comparable sales surged 9% year over year, with strong growth in both the U.S. and international markets. This performance brought the company's full-year comp sales growth to 5.6%. That was its best result by far since the Great Recession.

The exterior of a Best Buy store

Best Buy posted strong comp sales growth last quarter. Image source: Best Buy.

Best Buy's stellar sales performance drove a big uptick in incentive compensation. Furthermore, Best Buy is investing in various long-term growth initiatives that are putting pressure on costs. Nevertheless, the company's sales growth more than offset these headwinds. As a result, EPS reached $2.42 in the fourth quarter, up substantially relative to the prior year.

Profiting from the demise of Sears

Just last month, I cast doubt on one Wall Street analyst's contention that Best Buy would be the biggest winner if Sears Holdings (NASDAQOTH:SHLDQ) has to close all of its stores. After Best Buy's Q4 earnings report, it looks as if I may have to eat my words.

Sears Holdings has been closing stores at a rapid pace in the past year. Meanwhile, comp sales at the remaining stores have plunged. Best Buy has seized this opportunity to gain market share in the appliance business, while also consolidating its strong position in consumer electronics.

The exterior of a Sears department store

Sears' sales declines have accelerated over the past year. Image source: Sears Holdings.

During the fourth quarter, Best Buy posted an enormous 20.7% comp sales gain in the appliance category within the United States. In the international market, appliance comp sales growth reached 45.8% last quarter, on top of a 38.4% increase a year earlier. These enormous increases were clearly driven by Sears' massive downsizing, as well as the liquidation of Sears Canada, an independent company. Sears' woes probably also contributed to Best Buy's comp sales growth in the consumer electronics segment.

To be fair, appliance sales still account for less than 10% of revenue at Best Buy. Thus, the category's growth wasn't the main driver of Best Buy's huge comp sales increase last quarter. Instead, the company benefited from easy comparisons in the smartphone category, as recalls and the discontinuation of Samsung's Galaxy Note 7 had sabotaged sales in the previous year's holiday quarter. Meanwhile, the new Nintendo Switch drove huge sales growth in gaming last quarter.

However, comparisons in mobile phones and gaming will get much tougher in the next few quarters. By contrast, the sales benefit from Sears' store closures will presumably continue to build, with billions of dollars of annual revenue up for grabs.

How much is baked into the stock price?

Based on Best Buy's stellar sales growth last quarter, the company's ambition of generating sustainable sales growth seems more plausible than it did just a few months ago. On the other hand, the stock price is a lot higher. Best Buy stock has surged nearly 70% in the past year, with the bulk of those gains coming just since November.

BBY Chart

Best Buy stock performance, data by YCharts.

Shares of Best Buy currently trade for more than 13 times projected fiscal 2021 EPS of $5.50-$5.75. The company's Q4 results do suggest that there is upside to this target. Yet it's hard to tell right now how much of Best Buy's gains are being driven by temporary factors (e.g., the easy comparison in mobile and share gains at the expense of Sears and other failing rivals) and cyclical factors (e.g., a popular gaming console launch and a strong housing market).

For Best Buy stock to reward long-term investors, the company would need to continue posting steady EPS growth beyond fiscal 2021. It's still not clear that this is realistic, as competition with larger general merchandise retailers will remain vicious. Thus, shareholders may want to consider locking in some of their gains.

Adam Levine-Weinberg has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.