Oil prices surged on Wednesday, rebounding from seven-week lows, driven by escalating tensions in the Middle East following the assassination of Hamas leader Ismail Haniyeh in Iran. This geopolitical upheaval overshadowed concerns about weak demand from China. Brent crude futures climbed $1.80, or 2.29%, to $80.43 a barrel, while U.S. West Texas Intermediate crude futures increased by $2, or 2.68%, to $76.73 a barrel.

The rise in oil prices comes amid heightened geopolitical risks, with significant developments in the Middle East fueling market volatility. On Tuesday, Israel executed two airstrikes, one targeting Fuad Shukr, a senior Hezbollah commander in Beirut, and the other killing Ismail Haniyeh in Tehran. These actions have intensified fears of a broader conflict in the region, impacting global oil markets.

"The killing of Haniyeh is a dramatic escalation that has far-reaching implications for regional stability," said Gaurav Sharma, an independent oil analyst in London. "While this may provide a temporary boost to oil prices, the sustainability of this spike depends on whether the conflict extends to critical oil and gas infrastructure."

The assassination of Haniyeh, a key figure in Gaza ceasefire negotiations, has jeopardized ongoing peace talks. His death could derail efforts brokered by Qatar, the U.S., and Egypt to establish a ceasefire in Gaza, exacerbating an already volatile situation. Iran's supreme leader, Ayatollah Ali Khamenei, vowed revenge against Israel, stating that the country had "prepared a harsh punishment for itself."

Israel's strikes also drew condemnation from Lebanon and Iran, with Lebanon's Prime Minister Najib Mikati denouncing the attack as a "blatant violation of Lebanon's sovereignty." The strikes have further strained relations in the region, with potential ramifications for global oil supply.

Despite these geopolitical tensions, broader market concerns persist, particularly regarding China's demand for oil. China's manufacturing activity contracted for the third consecutive month in July, raising fears about the country's economic health and its impact on global oil demand. "Concerns about Chinese demand remain elevated," noted Charalampos Pissouros, a senior investment analyst at brokerage XM. "This suggests that any additional gains due to intensifying tensions in the Middle East may remain limited and short-lived."

In the U.S., crude, gasoline, and distillate inventories fell last week, according to the American Petroleum Institute. The Energy Information Administration reported a drop in crude inventories by 1.1 million barrels, aligning with market expectations and providing some support to oil prices.

Looking ahead, the focus will be on OPEC+ and its upcoming joint ministerial monitoring committee meeting. Analysts expect OPEC+ to stick to their current deal on production, with some output cuts potentially being unwound from October. This could influence oil prices, balancing the impact of geopolitical tensions and market fundamentals.

"The market is navigating a complex landscape of geopolitical risk and economic uncertainty," said Pissouros. "While the Middle East situation adds a layer of volatility, underlying demand concerns, particularly from China, will continue to weigh on the market."