U.S. stocks climbed sharply higher Tuesday as a rebound in oil prices helped reinvigorate bullish sentiment on Wall Street.

The Dow Jones Industrial Average finished near session highs, posting a triple-digit point gain while the S&P 500 index scored solid broad-based gains, propelling the index to a 1% annual gain with two sessions of trading left in 2015.

Tuesday’s action saw investors purchase shares of technology and health-care stocks.

Shares of Alphabet Inc. GOOGL, -3.45% GOOG, -3.42% , formerly known as Google, advanced 1.5%, and Amazon.com Inc. AMZN, -4.12% gained 2.8%. Both stocks hit all-time highs.

The S&P 500 SPX, -2.37% rose 21.86 points, or 1.1%, to 2,078.36, with all 10 main sectors finishing in positive territory. More than 95% of its components closed higher.

Read also: Amazon, Alphabet pegged as next Dow additions after Apple

The Dow Jones Industrial Average DJIA, -1.92% jumped 192.71 points, or 1.1%, to 17,720.98, with all of its components closing higher, with the exception of Walt Disney Co. DIS, -3.08% , down 0.2%.

Meanwhile, the Nasdaq Composite COMP, -3.01% gained 66.95 points, or 1.3%, to 5,107.94, aided by a 5.9% climb for the iShares Nasdaq Biotechnology ETF IBB, -1.26%

“Investors are looking for any excuse to get back into markets, so a jump in oil—which is seen as a sign of price stabilization—is giving investors reasons to buy up technology and health-care stocks,” said Karyn Cavanaugh, market strategist at Voya Financial.

The U.S. oil benchmark CLG26, rallied 2.9% to finish at $37.87 a barrel, erasing much of the previous session’s rout. However, the big gains for crude didn’t translate to sharp advances in the energy sector, which added 0.6%—one of the session’s smallest advances among the main S&P 500 sectors.

Despite the Tuesday rebound, U.S. oil futures remain down more than 9% since the end of November and are on track for a 2015 drop of nearly 30%.

Analysts will follow oil prices closely, as repercussions of the plunge in oil have filtered through into corporate bond markets, which had a high concentration of high-yield bonds among struggling energy companies.

“Most of the gains on Wall Street are linked to oil price moves and it looks likely that the trend of tight correlation between stocks and oil will continue in early 2016,” said Randy Frederick, managing director of trading and derivatives at Schwab Center for Financial Research.

Frederick noted much of what happens in stock markets next year will depend on whether oil prices stabilize and whether the dollar keep appreciating or not.

Not everyone was sanguine about Tuesday’s moves. Some analysts noted that sharp gains in a handful of the largest companies has masked weak returns on the S&P 500. For example, the S&P 500 Equal Weighted Index is down more than 3% year to date.

See: When do markets around the world close on New Year’s Eve?

Still, Wall Street analysts are slightly optimistic for the new year, as 10 analysts polled by MarketWatch have an average year-end S&P target of 2,193. That implies a gain of about 5% from the current level of 2,077.

Other markets:European equities SXXP, -0.31% closed higher, and Asian markets finished with gains, led by Australia. A key dollar index DXY, +0.11% was slightly higher and gold futures US:GCG6 ended less than 0.1%, lower at $1,068 an ounce.

Individual movers: Shares of Freeport-McMoRan Inc. FCX, -5.80% rose 1.8%, rebounding from a selloff Monday that followed the resignation of executive chairman James R. Moffett. He stepped down months after activist investor Carl Icahn took a 8.5% stake in the company.

Among the gainers, retail stores stood out. Kohl’s Corp KSS, -3.21% gained 3.3% and Gap Inc. GPS, -0.95% gained 2.1%.

Shares in Willis Group Holding PLC US:WSH and Towers Watson & Co. TW, -1.31% , which are merging, were up 4.6% and 4% respectively after S&P Dow Jones Indices announced late Monday that Willis Tower Watson would join the S&P 500.

Pep Boys PBY, -1.23% jumped 8.8% following news late Monday that billionaire investor Carl Icahn has raised his bid for the car parts and repair chain to value it at $1 billion.

Economic news:U.S. home price gains quickened in October, and several cities saw double-digit growth. The S&P/Case-Shiller 20-city composite index rose 0.1% for the three-month period ending in October, for a 5.5% yearly gain

The U.S. advance goods trade deficit widened to $60.5 billion in December versus $58.4 billion.

The consumer confidence index, meanwhile, rose and confidence in November was revised higher.