This story was updated at 4 p.m. EDT

U.S. stocks closed mildly higher Thursday after wavering during afternoon trading, with the Dow Jones Industrial Average leaping as much as 189 points, only to pare gains and close up 77 points above the previous day's close. Equities initially struggled to maintain morning gains after global shares dropped, while weak data out of China and Japan -- the world’s second- and third-largest economies -- heightened concerns about slowing global growth.

The Dow Jones Industrial Average (INDEXDJX:.DJI) rose 76.83 points, or 0.47 percent, to close at 16,330.40. The Standard & Poor's 500 index (INDEXSP:.INX) edged up 10.24 points, or 0.53 percent, to end at 1,952.28. The Nasdaq composite (INDEXNASDAQ:.IXIC) added 39.72 points, or 0.84 percent, to finish at 4,796.25.

Stocks continued their wild roller-coaster ride, following the previous day’s losses, when U.S. stocks plunged sharply in the final minutes of trading Wednesday, sending the Dow nearly 240 points lower by the day's end.

Global shares in Asia and Europe fell on renewed concerns about China's economy decelerating faster than previously thought, coupled with the uncertainty surrounding whether the U.S. Federal Reserve will announce an interest rate hike for the first time in nearly a decade next week.

“That group [the Fed] really has reached no consensus on when the next step should be taken, or even if it should, and that, my friends, is the cherry on top of the sundae that is market volatility,” Stephen Guilfoyle, managing director of NYSE floor operations at Deep Value Inc., said in a note Thursday.

Economists say an isolated China slowdown would have limited consequences for the robust U.S. economy. However, the greater risk for America is a generalized slowdown in global trade and financial flows.

“It is not the direct threat of hard landing in China that is worrisome, but rather the indirect consequences. The major threats would come from reduced trade flows with emerging markets, a sharp U.S. dollar appreciation stemming from competitive devaluations and financial contagion,” Gregory Daco, head of U.S. macroeconomics at Oxford Economics, said in a note.

Five of the 10 Standard & Poor's 500 sectors traded higher, led by gains in technology and healthcare stocks. Uitilities were the biggest decliner, down around 0.5 percent. 

Dow component Apple Inc. (NASDAQ:AAPL) led the index higher, jumping 2 percent to close at $112.28, after shares fell a day earlier following its iPhone 6S unveiling event. The tech giant's gains also helped lift the Standard & Poor's 500 and Nasdaq composite.

Following Apple’s highly anticipated launch event this week, FBR Capital Markets maintained its Outperform rating on Apple, with a 12-month price target of $175. The iPad Pro is a “potential door opener” for Apple on the enterprise front that could help revitalize growth, the firm said.

Adding that Wall Street will focus on whether the new features in the iPhone 6S models, including Force Touch and a 12-megapixel camera, can spur a surge of upgrades across the Apple customer base.

“With less than 30 percent of customers upgrading to iPhone 6 to date, coupled by this innovative 6s model, we believe the stage is set for Apple to catalyze growth on the heels of this super-cycle product upgrade for the coming quarters and thus help reverse the negative investor tide (e.g. China) hovering over this ‘prove me’ name,” Daniel Ives, an analyst at FBR Capital Markets, said in a note.

Shares of Apple have lost roughly 11 percent since July 22, a day after the company said its iPhone sales -- its biggest product category by unit sales and revenue -- came in at 47.5 million, below Wall Street’s forecasts for 50 million.

Meanwhile, fewer Americans filed new claims for unemployment benefits last week as initial claims for state unemployment benefits dropped 6,000 to a seasonally adjusted 275,000 for the week ended Sept. 5, the Labor Department said Thursday.

Initial claims for unemployment insurance have been below 300,000 for 27 straight weeks, the longest such stretch since the 1970s. Claims below the 300,000 threshold is considered to be a mark of a strengthening labor market.

Oil prices closed higher Thursday after initially paring early gains on fears of oversupply after U.S. crude stockpiles rose by 2.6 million barrels last week, the U.S. Energy Information Administration said. At 458 million barrels, U.S. crude oil inventories remain near levels not seen for this time of year in at least the last 80 years.

Following the report, West Texas Intermediate crude, the benchmark for U.S. oil prices, traded 4 percent higher to $45.81 per barrel for October delivery on the New York Mercantile Exchange. On the London ICE Futures Exchange, Brent crude, the global benchmark for oil prices, rose 1.2 percent to $48.78.

Asian shares dropped Thursday after China announced that producer prices, or wholesale inflation, remained in deflation last month, while Japan’s machinery orders, a leading indicator of capital expenditure, unexpectedly fell in July.

China’s producer price index dropped 5.9 percent in August after declining 5.4 percent the prior month, marking the 42nd consecutive month of declines. Following the report, China’s benchmark Shanghai Composite index closed down 1.5 percent.

Meanwhile, Japan's core machinery orders fell 3.6 percent in July, missing analysts’ forecasts for a rise of 3.7 percent, sending the Nikkei index down 2.5 percent. The losses came a day after Japan's benchmark index surged 7.7 percent, posting its biggest gain since October 2008, helped by the prospect of corporate tax cuts and additional stimulus in China.

European stocks closed lower following Asia’s weak lead, sending Germany's DAX and France's CAC down 0.9 percent and 1.5 percent, respectively.