Stocks turned positive as investors began to take heart from a series of positive reports about jobs and service sector growth, although energy and materials stocks remained weak.
The Dow Jones Industrial Average rose more than 20 points after eking out a new highon Tuesday as a broad range of commodities came under pressure.
Disney and American Express gained, while Coca-Cola and Microsoft fell.
The S&P 500 traded flat, while the Nasdaq rose slightly. The CBOE Volatility Index, widely considered the best gauge of fear in the market, rose above 17.
Among key S&P sectors, energy, utilities and materials declined, while financials and consumer discretionary rose.
Copper, often seen as a bellwether for economic activity because of its multiple uses, rebounded after trading off on Tuesday. Gold remained slightly weaker.
Oil, meanwhile, fell initially, but the wide sell-off attracted buyersto London Brent crude oil and U.S. crude oil futures. Earlier, the U.S. Energy Information Administration reported that crude oil inventories fell by about 4.2 million barrels, while on Tuesday, the American Petroleum Institute, an industry group, reported a 7.5 million barrel drop in crude inventories for the week ended Dec. 31.
The dollar strengthened more than 1 percent after the jobs news, and was up to session highs against a basket of foreign currencies. Meanwhile, the 10-year Treasury note fell on the stronger economic newsby one point, pushing the yield back to 3.4 percent.
The early weakness in the markets followed a downturn overseas, as markets weighed the continuing concerns about economic growth by Federal Reserve officials in the U.S. as well as sliding commodity prices, particularly in industrial metals, Kevin Kruszenski, head of listed trading at KeyBanc Capital Markets in Cleveland told CNBC.com.
"The market has been following copper and other industrial metals, so the market started lower," Kruszenski said. But with good economic news on the job front, he said, "I wouldn't be surprised to see the market up on the day."
Generally, the tone to the market remains upbeat, Kruszenski said. In a note to clients, Jim Paulsen at Wells Capital Management agreed, pointing to "self-sustaining" economic recovery. Paulsen said stocks should continue to rise this year, although they are unlikely to move in a straight line. At a multiple of 17 times current consensus earnings, the S&P 500 could hit 1,350, he said.
Alcoa was among the leading decliners among materials stocks after Citigroup downgraded the aluminum producer to a "hold." Other laggards included Cliffs Natural Resources , Newmont Mining and Freeport McMoran Copper & Steel .
Energy stocks remained largely lower even as oil prices rebounded.
Cabot Oil & Gas , Anadarko Petroleum and Sunoco were among the leading laggards.
Floods in Australia, which are harming areas where 50 percent of global coking coal supplies are produced, lifted many U.S. coal stocks. Coking coal is used to produce steel and iron ore.
Massey Energy , Patriot Coal and Peabody Energy all rose.
First Solar also rose slightly after news the renewable energy company will partner with China Guangdong Nuclear Solar Energy Development to build a solar field in China's Inner Mongolia region. The companies say the 2-gigawatt project will be the world's largest solar-energy project.
Quarterly earnings began to trickle in. Mosaic rose after reporting a big gain in profit on a surge in sales after the market closed on Tuesday.
But Family Dollar shares tumbled nearly 8 percent after the discount retailer reported a lower-than-expected profiton compressed margins and higher freight costs.
In other news, retailers have enjoyed a strong holiday season for sales, according to MasterCard SpendingPulse. Both apparel and high-end items saw strong sales growth in December, the new report said.
BJ's Wholesale Club declined Wednesday after news it will close five stores and cut hundreds of employees. The big box retailer—considered a takeover target—also reported disappointing same-store sales for December.
Walgreen's same-store sales also disappointed as pharmacy sales fell short of expectations. The drugstore chain's shares slipped.
Shares of Qualcomm and Atheros rose after news Qualcomm agreed to buy the semiconductor maker for $45 a share. Atheros shares rose 18.9 percent on Tuesday after the New York Times reported the news.
Meanwhile, Qwest Communications slipped after Argus Research cut the Internet communications provider to "sell" from "buy."
Borders rose slightly after news in the New York Times that the struggling bookstore chain is talking with publishers about converting deferred payments into interest-bearing debt. The Times also said people close to Barnes & Noble would prefer to focus on digital growth rather than a merger with Borders.
Disney's gain came after Goldman Sachs added the entertainment company to its "conviction buy," list, noting the company's parks division was expected to grow.
In U.S. economic news, the Institute for Supply Management's services sector index rose to 57.1 in December from 55.0 in November, better than expected and the fastest pace in more than four years. Economists surveyed by Reuters had forecast a reading of 55.6.
The employment component of the report, however, fell to 50.5 from 52.7 in November while new orders, a leading indicator, jumped to 63.0 from 57.7.
And private employers added 297,000 jobs in December, according to the ADP Employer Services report, jointly developed with Macroeconomic Advisers. That's far more than the 100,000 estimate by economists surveyed by Reuters. The previous month, private employers had added a revised 92,000 employees, slightly less than the 93,000 originally reported.
Also, planned layoffs in December fell to the lowest level since 2000, with just 32,000 furloughs anticipated, according to outplacement firm Challenger, Gray & Christmas.
Also, mortgage applications were mixed at the end of the year as rates reached seven-month highs. A seasonally-adjusted index of mortgage application activity rose 2.3 percent for the week ended Dec. 31, and fell 3.9 percent the week before.
Asian indexes ended mixed, but mostly lower in the wake of the commodities selloff. European shares closed down with as mining shares retreated. Portugal saw the yield on its 6-month T-bills rise at a debt auction to raise 500 million euros ($662.6 million).
On the Calendar This Week:
WEDNESDAY: Kansas City Federal Reserve President Hoenig speaks.
THURSDAY: Chain store sales, Monster employment index, jobless claims, natural gas inventories, Treasury STRIPS, money supply; earnings from Monsanto.
FRIDAY: Nonfarm payrolls report, consumer credit; Federal Reserve Chairman Bernanke speaks, Federal Reserve Vice Chairman Janet Yellen speaks.
More From CNBC.com: