NEW YORK (TheStreet) -- Stocks hovered near session highs by late afternoon Thursday as crude oil shook off an increase in inventories to close above $45 a barrel.

The S&P 500 was up 1%, the Dow Jones Industrial Average added 0.88%, and the Nasdaq gained 1.3%. Benchmark indexes had been listless earlier in the session with little to drive market direction.

Crude oil moved higher despite an increase in inventories over the past week. The U.S. added 2.6 million barrels to crude stockpiles last week, nearly triple an estimated increase of 900,000 barrels. West Texas Intermediate crude closed 4% to $45.92 a barrel to reverse Wednesday's losses. 

Major oilers including Exxon Mobil (XOM - Get Report) , Chevron (CVX - Get Report) , Halliburton (HAL - Get Report) and Royal Dutch Shell (RDS.A - Get Report) moved higher, while the Energy Select Sector SPDR ETF (XLE - Get Report) jumped 0.63%. 

Apple (AAPL - Get Report) shares were more than 2% higher as investors assessed the company's revamped Apple TV and updated iPhones. During its annual product event on Wednesday, Apple announced that its redesigned set-top box will feature voice commands using voice-activated personal assistant Siri and a touch interface. The company also unveiled a larger iPad, which will measure 12.9 inches on the diagonal, and a stylus for the iPad called Pencil which will retail for around $99.

Amazon  (AMZN - Get Report)  climbed 1.5% after announcing plans to discontinue its Fire Phone after selling through its inventory. The smartphone had received poor reviews upon its release in 2014 and has since seen weak demand.

Other major tech stocks were also higher including Google (GOOGL - Get Report) , Microsoft (MSFT - Get Report) , Qualcomm (QCOM - Get Report) and Cisco (CSCO - Get Report) . The Technology SPDR ETF (XLK - Get Report) gained 1.3%.

Trading in Avon (AVP - Get Report) was briefly halted after a price surge triggered a circuit breaker. Shares jumped more than 12% before being halted. Once trading began again, shares fell back to gains of 1%. The company is reportedly holding talks with private-equity funds for a new round of investments, according to The Wall Street Journal.

Global markets were lower Thursday, taking their cue from heavy declines in U.S. equities a day earlier. Major U.S. benchmark indexes declined more than 1% as a selloff in crude oil hit the energy sector hard.

In Europe, Germany's DAX fell 0.9%, France's CAC 40 slid 1.2%, and the FTSE 100 in London stumbled 1.2%.

Asian markets were also lower, though massive declines had tapered off on Thursday. China's Shanghai Composite fell 1.4% and the Nikkei in Japan fell 2.5%.

China's consumer prices rose 2% in August, up from 1.6% in July, as a nearly 20% surge in pork prices increased food expenses. Meanwhile, producer prices looked worse for wear, sliding 5.9% in the 42nd straight monthly decline.

Japanese machinery orders posted a surprise drop of 3.6% in July, a far cry from an expected increase of 3.7%. The measure is an indicator of capital expenditure and economists had hoped it would have seen a healthy boost from lower energy prices.

Weekly jobless claims fell 6,000 to 275,000 in the week ended Sept. 5, an indication the labor market continued to tighten. The result was as economists had expected. The average number of new claims for unemployment benefits over the past month rose 500 to 275,750, according to the Labor Department.

Import prices fell 1.8% in August, their biggest decline of 2015, as oil prices remained low and the high U.S. dollar made foreign goods cheaper. Over the past year, import prices have dropped 11.4%, their largest decline since 2009.

Lululemon (LULU - Get Report) reported a better-than-expected second quarter, benefiting from an increase in sales and a greater number of stores. The athletic apparel company reported comparable-store sales rose 6% over the quarter, while total revenue jumped 16% to $453.01 million.

XPO Logistics (XPO - Get Report) fell after it agreed to buy Con-Way (CNW) for $3 billion. XPO will become the largest freight transportation company in the U.S. following the deal. XPO shares were down 13.8%, while Con-Way soared 33.9%.

Hard-drive developer Seagate (STX - Get Report) fell 0.5% after announcing plans to cut 1,050 jobs, or 2% of its work force, as it commits to a restructuring program. The job cuts are expected to save $113 million annually.

Mondelez (MDLZ - Get Report) shares were on watch after the company detailed plans to increase advertising spending and expand its e-commerce business. The snack maker plans to increase ad spend to 10% of revenue by 2018, up from 8% in 2014. E-commerce revenue is also expected to rise to $1 billion over the next five years, 10 times higher than current levels.