More:Government shutdown: How it could hurt the economy

More:Consumers not buying into 'far too high' iPhone prices

More:These vehicles will be killed in 2019: Say goodbye to Chevrolet, Ford, Nissan cars

Stocks closed out a bruising 2018 with gains on New Year's Eve but the rally wasn't enough to help the market avoid its biggest annual loss in 10 years.

The Dow Jones Industrial Average, which rallied 265 points in the year's final trading day, finished 2018 with a loss of 5.6 percent, its worst decline since a 33.8 percent drop in 2008. The broad Standard & Poor's 500 stock index fell 6.2 percent in 2018, its worst performance in a decade.

Despite Monday's rally, which was sparked by signs of progress in trade talks between the U.S. and China, the S&P 500 still posted its biggest December decline since 1931 and narrowly dodged its first bear market since 2009 on its way to its worst annual performance since the financial crisis.

In a tweet over the weekend, President Donald Trump said he spoke with Chinese counterpart Xi Jinping about the trade dispute between the world's two biggest economies and that "Big progress was being made!" That news was greeted positively by investors, as slowing economic growth, due in part to tariffs and trade-related uncertainty, has weighed heavily on stocks.

Wall Street experienced highs and lows in 2018, with the S&P 500 notching its longest bull run in history on its way to a record high in late September. But it morphed into a treacherous year for investors, as the stock market suffered two corrections – or drops of 10 percent or more from prior highs. The benchmark stock gauge on Christmas Eve also came within two--tenths of a percentage point of tumbling 20 percent from its peak on a closing basis and into bear market territory.

"That sure felt like a bear," said John Lynch, chief investment strategist at LPL Financial.

That narrow miss kept the bull market, which began in March 2009, intact.

Volatility returned to Wall Street with a vengeance in the final three months of the year, with stocks cratering under the weight of fears of recession, concern about the Federal Reserve hiking interest rates, trade war uncertainties and signs of a global economic slowdown.

More:Stock market is open for full day of trading New Year's Eve, but closed Jan. 1 for New Year's Day

More:Dow outlook: Why I'm optimistic about the stock market for 2019

More:Why now is the perfect time to look over your IRAs, 401(k)s and other retirement accounts

After a 0.9 percent gain on the year’s final trading day, the S&P 500 finished 2018 14.5 percent below its Sept. 20 peak of 2,930.75.

The blue chip Dow ended the year 13 percent shy of its recent peak. The Nasdaq composite, home to popular technology stocks that led the market surge early in the year but which suffered massive declines in the year’s final quarter, finished 2018 down 3.9 percent and 18.2 percent below its August all-time high. The small-company Russell 2000 stock index suffered the biggest decline, tumbling 12.2 percent and enters the new year 22.5 percent from its peak and deep in bear market territory.

Investors are bracing for more volatility but are hoping for a return to gains in the new year.

"Barring an appearance of a 'black swan' event, or the shock of a bolt from the blue, the worst of the declines experienced by stocks in 2018 are behind us," John Stoltzfus, chief investment strategist at Oppenheimer Asset Management, told clients Monday in his 2019 outlook report. He predicts the S&P 500 will rebound 20 percent next year from current levels.

But some Wall Street firms are still preaching caution in the new year, arguing that the late-year 2018 stock rally isn't proof that the market has hit bottom.

Will Geisdorf, an analyst at Ned Davis Research, told clients the market bounce "has not changed the (firm's) bearish view." Currently, the firm is telling clients to reduce their stock holdings to just 40 percent of their portfolios, which is the lowest allocation they recommend.

For now and until there is "more compelling evidence" that stocks have hit a bottom, Geisdorf is advising clients to use market rallies as "selling opportunities."

Investors who bid up stock prices early in 2018 based on the strongest profit growth for U.S. companies since 2010, tailwinds from sizable tax cuts and a U.S. economy growing at a 3 percent-plus clip, sold stocks off sharply late in the year as they began to price in a less positive backdrop for stocks.

A sense that the best days for corporate profits and the global economy had already occurred led investors to reprice stocks at lower levels.

Next year's market returns will hinge on interest rate policy, whether the economy can continue to grow and avoid recession, and whether the U.S. trade fight with China can be resolved.

For now, bulls are betting that stocks will find support from the fact that valuations have come back toward historical averages after the steep sell-off and a belief that the U.S. economy can avoid recession if the Fed doesn't hike interest rates too aggressively in 2019.

"Several risks still in play could weigh on markets," LPL's Lynch says. "But the broader economic context remains supportive."