(Bloomberg) — Digging beneath the surface of what was otherwise an unremarkable month for U.S. stocks exposes a rare event that bodes well for bulls if history is any guide.

While the Standard & Poor’s 500 Index finished February 0.4 percent lower, what’s remarkable is that the benchmark retraced almost 95 percent of a loss that topped 5 percent. Such reversals happen just once every four years on average in data going back to World War II, with stocks trading higher by 12 percent a year later compared with a normal 12-month return rate of 8.7 percent.

While trepidation remains that uncertain Federal Reserve interest-rate policy and slowing growth in China could still derail stocks, more than $1 trillion was restored to equity values in the final two weeks of the month, as investors who sent stocks to their worst start to a year on record found solace in rising oil prices and firming U.S. economic data. The rally that started Feb. 12 also got a boost from falling valuations, the return of corporate buybacks and a squeeze on bears who had expected declines to deepen.

“Most of the selloff in the first half of the month was due to concerns about the global financial condition,” said Jack Ablin, the chief investment officer at BMO Harris Bank NA in Chicago. “We had low expectations, but actual conditions came in better than expected, which helped change the attitude.”

Enthusiasm was tempered on the month’s final day, as the S&P 500 slumped 0.8 percent to finish at 1,932.23. While the slide gave the index its third straight monthly loss, the longest retreat since 2011, the index still added more than 100 points from its low in February. The Dow Jones Industrial Average climbed 0.3 percent, overcoming a slide that reached 4.9 percent at its trough.

The S&P 500 climbed 0.9 percent at 10:15 a.m. in New York on the first day of March.

Based on past intramonth rebounds similar to February’s, the S&P 500 will rally to about 2,160 in a year. Wall Street strategists currently predict the index will end the year at 2,158, according to the average of 21 estimates compiled by Bloomberg.

As the bull market in American equities approaches its seventh anniversary, pullbacks that previously generated buying opportunities have failed to spark lasting rallies since August, when China’s surprise devaluation of its currency and crude’s slump to levels last seen in 2009 roiled financial markets. The S&P 500 remains 9.3 percent below its May record.

Reasons for optimism have been growing, though, as data on the pace of economic expansion and manufacturing topped expectations amid signs that consumers can continue to power the world’s largest economy. A monthly retreat in the dollar bolstered the prospects for corporate earnings that have fallen for three straight quarters.

“The month began with some concerns about growth of the U.S., but the developments posted mid-month led investors to believe that we might be right at the end of the tunnel,” said Wayne Lin, New York-based money manager at QS Investors LLC.

There were technical aspects to the second-half rally, as valuations and corporate buybacks buoyed shares. At a 22-month low on Feb. 11, the S&P 500 traded at 16.5 times earnings, the bottom of a range Oppenheimer & Co. identified as providing a floor for the market since February 2014. The gauge also closed above its 50-day moving average for the first time this year before finishing less than 0.5 percent below that level.

Companies resumed purchases through buyback programs, reviving a reliable source of demand for stocks after enacting a blackout period during earnings season, according to Goldman Sachs Group Inc.

Financial and consumer shares that had suffered the biggest losses in 2016 led the rebound, jumping more than 7 percent. Other hard-hit sectors staging comebacks included materials producers and industrial shares, whose returns for the whole month exceeded 3.5 percent.

Companies with the highest short interest were also among the best performers. GameStop Corp., the stock with the highest percentage of short interest in the S&P 500, jumped 18 percent in February. A Goldman Sachs Group Inc.’s gauge of the most shorted stocks saw its best monthly advance since May, rising 2.6 percent.

While measures of investor anxiety reflected fear’s loosening grip, with the Chicago Board Options Exchange Volatility Index tumbling 27 percent from its 2016 peak, there were signs of lingering caution among investors. The end-of- month rally came amid the weakest trading volume of the year, and investors showed reluctance to take big risks, with mega- caps outperforming smaller companies. Even after the rebound, the S&P 500 sits 5.5 percent lower this year.

As a large portion of investors watched the rally from the sidelines, bears who had been burned by the gains stuck to their bets against stocks. Hedge funds and large speculators held about the same number of net short positions on the S&P 500 as they did before the rebound and raised their bearish wagers against small-cap stocks, data from the Commodity Futures Trading Commission show.

“When I see that much bearishness, it actually makes me feel a little bit more comfortable that at some point, when people finally give up, that’s when things turn around,” said Tom Cassidy, chief investment officer at Univest Wealth Management in Souderton, Pennsylvania, where the firm oversees $3 billion. Right now, “I’m not totally convinced that we’re out of the woods yet,” he said.

See also:

The top 5 concerns of insurance executives today

Copyright 2018 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.