The stock market has officially entered bear market territory with the S&P 500 down over 21% year to date. There's a chance it could fall further with inflation running at 40-year highs, the Federal Reserve poised to aggressively raise interest rates, and consumer confidence at all-time lows.

It's easy to buy winning stocks in a bull market; after all, a rising tide lifts all boats. More difficult is finding those that can perform well in a downturn. Investors would do well to turn to dividend-paying stocks, as they can offset the sting of any capital loss by offering a steady stream of income. 

Dividends tearing through a $1 bill.

Image source: Getty Images.

And dividend stocks that can also hold up better than most in rough seas are better still, which is why I think investors should take a close look at ABM Industries (ABM 0.14%). It's not only a dividend-paying safe haven, but it also does well when times turn tough.

The power of dividends

ABM Industries is a sleepy sort of investment -- it provides janitorial services and facilities management to businesses -- that simply performs well over long periods. Even during the so-called "lost decade" of the 2000s, when the market had one of those rare occurrences where it generated negative returns over a 10-year period, ABM's stock conducted a clinic on how to thrive, returning over 158% between Jan. 1, 2000 and Dec. 31, 2010.

Including dividends, ABM Industries more than tripled an investor's investment during that time.

^SPX Chart

^SPX data by YCharts

Investors shouldn't be surprised. The asset managers at Hartford Funds found dividend-paying stocks contributed 41% to the total return of the S&P 500 stretching back to 1930. Dividend stocks have always generated positive returns over rolling 10-year periods during that 90-year time frame, regardless of whether there were wars, recessions, or even depressions.

A solid record of growth

Although you might not have heard of it, ABM Industries was founded over 100 years ago and has operated through all of those calamities. It has also paid a dividend every year for 57 years and has raised the payout for over 50 years, making it a member of that elite group of companies known as Dividend Kings.

Now might also be a perfect time to buy it, too. ABM reported second-quarter earnings on June 9th that beat Wall Street profit expectations, though it just missed on revenue. Despite management reaffirming its earnings outlook for the year, its shares tumbled hard afterward. The stock is down 21% over the past week.

According to Baird analyst Andrew Wittmann, ABM margins may get roughed up a little bit in the current economic environment, especially on labor costs, but the worst of the labor challenges are in the rearview mirror now. ABM's sales are solid, customer retention is stable, and the acquisitions it's made are helping to bolster the business.

Wittman retains a neutral rating on the stock with a one-year $50 price target, which would make it fairly priced at current levels, but I'm much more bullish and find its stock significantly discounted now.

ABM is able to mitigate much of the labor concerns, including rising labor costs, because two-thirds of its workforce is covered under collective bargaining agreements. And while it has seen some costs rise in non-unionized areas, such as the south, it has been able to offset them with price increases.

Moreover, its competition also experiences rising labor costs so there is no lost competitive advantage because of it. Although it doesn't expect the labor shortages to evaporate over the next few quarters, it is looking for it to ease considerably, especially because inflation is forcing more people back into the workforce.

Cleaners cleaning glass.

Image source: Getty Images.

Time to clean up

ABM Industries shares trade at less than 10 times next year's earnings estimates, while Wall Street continues to forecast long-term earnings growth of 16% annually. It is trading at just a fraction of its sales and 11 times the free cash flow it produces, a bargain-basement rate. And let's not forget its dividend, which is yielding 2% annually.

ABM has had a long, steady career through all kinds of market conditions. It's been through the Great Depression, the high-inflation years of the 1970s and 80s, and the dead investment period of the 2000s, and it's still as healthy as ever.

No company is immune to the winds of change that blow through the market, but ABM Industries is a solid business that holds up well, even in down markets, and pays you for your patience until things start looking up again.