A comeback in technology stocks pushed the Nasdaq Composite up 0.4 percent to 6,783.91 as Amazon, Apple and Netflix all traded higher. Facebook stock rallied 2.4 percent while Google-parent Alphabet added 1.7 percent.

Stock of energy companies fell across the board as oil prices sank more than 7 percent to a 15-month low on Tuesday. Exxon Mobil fell 2.7 percent, Chevron lost 2.4 percent and ConocoPhillips dropped 1.9 percent as the U.S. and Russia continue to pump at record levels ahead of planned output cuts by OPEC and its allies.

New comments out of Washington appeared to spark the afternoon selling after Senate Majority Lead Mitch McConnell said that a proposed government funding plan was rejected by his Democrat colleagues. The Kentucky Republican proposed an appropriations bill that includes money for border security fencing, as well as what a Senate Democratic aide described as a $1 billion "slush fund" that Trump could use on his immigration policies. Democrats subsequently rejected the deal.

The Dow Jones Industrial Average added 82.66 points to close at 23,675.64 after erasing its 300-point rally earlier in the session amid a gain in Goldman Sachs, which posted its first positive day in 10 on Tuesday. Shares of Boeing also rose.

finished just above flatline at 2,546.16 after trimming a rally of more than 1 percent and falling into negative territory in afternoon trading at one point. The S&P 500 hit a new intraday low for the year, falling to 2,528.71 before recovering into the close. Market participants pointed to growing fears of a government shutdown, a slide in oil prices and worries that the Federal Reserve is going too far with its rate-hiking plans as reasons for the weak action.

The S&P 500 closed just above its 2018 low Tuesday as stocks struggled to keep a rebound alive throughout the session.

"I think it's anxiety about slowing economic growth and [traders] want assurance that someone's going to do something," said Bruce McCain, chief investment strategist at Key Private Bank.

"Clearly, it's a time of uncertainly both here and overseas, but given the strength of the economy, it's going to take some time until the economic backdrop supports a bear market," Key Private Bank's McCain added. "It's about managing your anxiety and waiting long enough to find out that, hopefully, the news isn't so bad."

Fears an expected rate hike from the Fed this Wednesday will be too much for the stock market and economy to handle sent the S&P 500 lower by 2 percent on Monday to 2,545.94 — and as low as 2,530.52 on an intraday basis. It's previous low was in February. The Dow Jones Industrial Average plunged 507.53 points on Monday — or 2.1 percent — to close at 23,592.98.

The Dow and S&P 500, which are both in corrections, are on track for their worst December performance since the Great Depression in 1931, down more than 7 percent so far for the month. The S&P 500 is now in the red for 2018 by nearly 5 percent.

"The bottom process look like it has to restart here. A lot of the internal breadth indicators we're watching have matched their lows from October," said Ari Wald, head of technical analysis at Oppenheimer.

"This could be the high intensity low. We're pretty deeply oversold here with only yesterday 17 percent of stocks on the S&P above their moving averages, close to levels form 2016 when you got as low as 13 percent," said Wald.

The Fed is widely expected to hike its benchmark overnight lending rate for a fourth and final time of 2018 when it concludes a two-day policy meeting on Wednesday. While fears of rising interest rates have spooked markets throughout the year, such concerns have heightened over the past month as inflation and growth expectations recede.

While traders see the odds of a December rate hike above 70 percent, investors will likely scrutinize — and react to — the Fed's outlook for 2019.

tweet

President Trump took aim at the Fed again on Tuesday, urging central bank members to not "let the market become any more illiquid than it already is."

"Feel the market," Trump encouraged, "don't just go by meaningless numbers. Good luck!"

Trump's tweet Tuesday follows his criticism of the Fed on Monday, when he said "it is incredible" that the central bank is "even considering yet another interest rate hike" amid the "outside world blowing up around us." Trump has openly criticized the Fed as well as Fed Chairman Jerome Powell several times in 2018.

— CNBC's Michael Sheetz and Eustance Huang contributed to this report.