U.S. stocks closed sharply higher on Wednesday, partly recovering from the worst start to September in 13 years, as investors eyed calmer global markets, domestic data, and oil prices. (Tweet This)
The major averages rallied more than 1.5 percent in the close to end near session highs, with the Nasdaq composite outperforming with gains of 2.46 percent to pull out of correction territory.
The S&P 500 also closed higher out of correction territory, while the Dow Jones industrial average remained in correction. The blue chip index ended three straight days of losses with a gain of 293 points. Apple surged 4.29 percent and Microsoft leaped 3.68 percent to lead nearly all blue chips higher, while information technology led all S&P sectors higher.
The iPhone maker's stock attempted gains for 2015 but remained in correction territory.
Energy turned mildly higher as crude oil recovered to settle up 1.85 percent at $46.25 a barrel. Earlier, crude fell as much as 4 percent to below $44 a barrel after the U.S. Energy Information Administration's weekly report showed oil inventories rose.
"I think that the stock market has been trading in concert with oil prices," said Kim Forrest, senior equity analyst at Fort Pitt Capital.
After a recent rally, crude settled 7.7 percent lower on Tuesday.
Earlier, the major averages held gains of about 1 percent or more after the Federal Reserve's latest Beige Book said economic activity continued to expand.
"I'm a little disappointed by the Beige Book. I was looking for more robust signs of growth," said Tara Sinclair, chief economist at Indeed. "It does make me wonder whether there's still room for the economy to grow."
The larger factor for investors on the timing of a rate hike remains Friday's nonfarm payrolls report.
"I think more or less what we see is markets digesting last week's rally. Problem is, we're in the lower part of the range," said Adam Sarhan, CEO of Sarhan Capital. The Beige Book is just "one piece of the puzzle" on determining the timing of a rate hike.
Treasury yields were little changed following the report, with the 10-year yield at 2.19 percent and the holding near 0.72 percent in choppy trade.
The U.S. dollar traded higher against major world currencies, with the euro near $1.12 and the yen near 120 yen against the greenback.
Trade was choppy throughout the day, with the major averages briefly halving sharp opening gains of about 1 percent.
"It appears that fewer people are willing to jump in and bottom fish," said Jack Ablin, chief investment officer at BMO Private Bank.
"The reason we're selling off is there are still sellers in the market who also want to raise cash," said Marc Chaikin, CEO of Chaikin Analytics. "They don't want to do it on weakness like we saw Monday afternoon or Tuesday. ... To me that suggests we are going to head lower."
"If this rally holds we may have put in a W-(shaped) bottom yesterday," he said.
European stocks closed mildly higher amid U.S. gains and milder declines in Asian stocks. After violent swings, the benchmark Shanghai Composite closed down 0.4 percent, after falling as much as 4.6 percent, as regulators stepped up rescue measures to support a wobbly stock market on Wednesday. Japan's Nikkei closed down about 0.4 percent and the Hang Seng ended down about 1.2 percent.
The mainland Shanghai and Shenzhen markets will be closed Thursday and Friday for a public holiday, while the Hong Kong exchange will be closed Thursday.
"I think it's more to do with stabilization in global markets," said Peter Boockvar, chief market analyst at The Lindsey Group.
"I'm more inclined to say what we've seen in the last couple weeks is the beginning of something more. The market's on edge until the Fed makes a decision," he said.
U.S. stocks closed nearly 3 percent lower on Tuesday for the worst first day of September trade since 2002. The Dow and S&P ended 2.5 percent above lows hit during last week's selloff.
Wednesday's attempted bounce might not be enough to offset a weaker September overall, if history is any guide. Analysis by Bespoke found that following declines of more than 1 percent on the first trading day of September, the S&P averaged a loss of 2.21 percent for the rest of the month, with positive returns just 40 percent of the time.
rose 0.4 percent, below consensus expectations for a 0.9 percent increase. The second-straight month of increases was driven by strong demand for auto sales. Durable goods orders for July were revised higher to 2.2 percent from 2.0 percent.
Before the open, futures extended gains after revised second-quarter productivity showed a rise of 3.3 percent, its strongest pace in one-and-a-half years, while labor costs fell 1.4 percent.
"We saw over 3 percent revision. That's good news in the sense there is more participation, there is more market output, a stronger economy emerging," said Peter Cardillo, chief market economist at Rockwell Global Capital.
"It just means no inflation and that's good news. The markets continue to say the (Fed) continues to miss its inflation target, which it has," he said.
Analysts also noted solid gains in weekly mortgage applications, which leaped 11.3 percent amid last week's dip in interest rates.
Dow futures briefly held less than 100 points higher after the ADP report missed expectations slightly, showing creation of 190,000 private jobs versus expectations of 200,000.
"Bottom line, this is another good but not great number and is a continued comedown from the pace seen last year. It is the fifth month in the past six that has seen private sector job growth of less than 200,000," Boockvar said in a note.
"I don't think that employment situation will have changed enough in this report," said Art Hogan, chief market strategist at Wunderlich Securities. It's "very hard to change the balance for the September meeting."
He also noted some encouraging signs in the consumer sector from Vera Bradley earnings, which came out before the bell.
The handbag and accessories maker reported better-than-expected second-quarter revenue, helped by new products and marketing, Reuters reported. The firm also forecast third-quarter earnings from continuing operations and revenue above analysts' estimates.
In other corporate results before the bell, Ambarella reported adjusted quarterly profit of 88 cents per share, beating estimates of 80 cents, while revenue was also above forecasts. However, the maker of video processing chips is seeing its shares under pressure, following a report warning of possible risks to GoPro's third quarter results. Ambarella is one of GoPro's key suppliers.
H&R Block posted a loss of 35 cents per share, 5 cents less than analysts had anticipated. Revenue beat estimates, and the company also announced a $3.5 billion stock buyback program.
The closed up 35.01 points, or 1.83 percent, at 1,948.86.
The Nasdaq closed up 113.87 points, or 2.46 percent, at 4,749.98.
The Dow transports jumped 2.45 percent, with JetBlue surging 6.4 percent to lead all constituents higher.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded near 26.
About three stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of nearly 1.1 billion and a composite volume of 3.7 billion in the close.
Gold futures for December delivery settled down 46.20 at $1,133.60 an ounce.
—CNBC's Peter Schacknow contributed to this report.
On tap this week:
Earnings: Five Below
Earnings: Medtronic, Campbell Soup, Ciena, Joy Global, Lands' End, Cooper Cos.
7:30 a.m.: Challenger Job-Cut report
8:30 a.m.: International trade, jobless claims
10 a.m.: ISM non-manufacturing index
10:30 a.m.: Natural gas inventories
11 a.m.: Oil inventories
9 p.m.: Minneapolis Fed President Kocherlakota speaks at forum in Missoula, Montana.
8:10 a.m.: Richmond Fed President Lacker speaks on the case against further delay
8:30 a.m.: Nonfarm payrolls
3 p.m.: Treasury Strips
More From CNBC.com: