(AP) -- A wobbly day of trading on Wall Street ended with most stock indexes managing slight gains, nudging the S&P 500 and Dow Jones Industrial Average to all-time highs.
The S&P 500 rose 0.1% after having been down 0.2% in the early going. The Dow Jones Industrial Average rose 0.2% and the Nasdaq slipped 0.1%. All three indexes started the day slightly in the green.
The benchmark S&P 500 index, which also set a record high last Friday and Monday, has now posted 70 record highs for the year. In the post-World War II era, that's the most new highs for the index since the 77 it set in 1954. The Dow last set a record high in early November.
The major U.S. stock indexes are on pace to close out this year with strong gains. With two trading days left this year, the S&P 500 is headed for a gain of more than 27% for 2021. That would be its best performance since 2019, another banner year for the market.
Better-than-expected corporate earnings growth helped fuel the market's rise this year and kept the indexes climbing to new highs, said Rob Haworth, senior investment strategist at U.S. Bank Wealth Management.
"As we finish out this quarter, earnings expectations by analysts have been ticking slightly higher for 2021," he said. "That's part and parcel of what's driven so many all-time highs. Things were much better than anticipated as we moved through the whole year."
The S&P 500 rose 6.71 points to 4,793.06. The Dow added 90.42 points to 36,488.63. The Nasdaq slipped 15.51 points to 15,766.22.
Smaller company stocks also rose. The Russell 2000 index gained 2.74 points, or 0.1%, to 2,249.24.
Gains in health care and technology stocks helped lift the S&P 500 Wednesday. Biogen jumped 9.5% for the biggest gain in the index, while Micron Technology rose 3.5%.
Retailers and companies reliant on consumer spending were among the better performers coming off the Christmas holiday shopping season. Target, Nike, Kroger and AutoZone all rose 1.3% or more.
Losses in communication, energy and financial stocks kept the market's gains in check. Facebook parent Meta Platforms slipped 0.9%, Exxon Mobil dropped 0.9% and Morgan Stanley fell 1.2%.
Investors have become more comfortable with the omicron variant of the coronavirus in the last couple of weeks. The quickly spreading virus appears to be less severe and cause less death and hospitalization than other versions of the virus.
However, much is still uncertain about omicron, which is spreading extremely quickly and leading to a return to pandemic restrictions in some places. The variant is quickly becoming the dominant strain throughout the world.
"What the market is still trying to sort out is what is the impact of the rise in omicron cases here in the U.S.," Haworth said.
While virus-related lockdowns and travel restrictions remain a big concern, most big investors have closed out their positions for 2021 and are likely to hold their ground until next week. Trading this week has been slow, with less than 3 billions shares exchanging hands on the New York Stock Exchange the last two days, compared to the 4.5 billion shares typically bought and sold on an average day.
Bond yields have moved higher in the final days of 2021. The yield on the 10-year Treasury note rose to 1.55% compared with 1.48% late Tuesday.
Energy futures mostly rose. The price of U.S. crude oil rose 0.8%.