Oil has completed a stunning return to triple digit territory, with China now positioned to determine whether the rally continues toward wartime highs or loses momentum.

American crude settled above $102 per barrel on Thursday, its highest closing level since May.

The futures contract has surged roughly 50 percent from its summer low of $68.55.

That bottom arrived about three weeks after Washington and Tehran signed a memorandum of understanding on June 17, an agreement that has since collapsed.

Fresh gains came as fighting across the Middle East intensified and Saudi Arabia shut its crucial East West oil pipeline following multiple attacks.

The disruption reinforced concerns about regional supply security and restored a larger geopolitical premium to crude prices.

Bob McNally, president of Rapidan Energy, said the market has gradually rebuilt that premium since the agreement failed and the United States reimposed its naval blockade of Iran in July.

Even after the latest advance, American crude remains below its April 7 wartime closing high of $112.95.

Rebecca Babin, senior energy trader at CIBC Private Wealth, believes traders have accounted for much of the latest military escalation.

They may not have fully priced the possibility that Chinese refiners will accelerate crude purchases and intensify competition for available barrels.

“What isn’t reflected is the fact that we may actually see a stronger demand pull for crude as refiners start to really try to ramp up in China, tightening the market further,” Babin told CNBC’s “Squawk Box” Friday.

China has operated as a swing consumer during the Iran war, helping prevent crude prices from soaring even further.

McNally estimates that the country reduced imports by between 3 million and 5 million barrels per day while drawing support from petroleum reserves exceeding 1 billion barrels.

“The biggest factor containing crude oil prices since this thing started is China’s crash diet,” McNally told CNBC’s “The Exchange” Tuesday.

“It’s coming off the diet and it’s thirsty and it’s hungry. It’s starting to bid crude up.”

Chinese refiners also face a powerful financial incentive to return. Diesel production margins have climbed dramatically because the conflicts involving Iran and Ukraine have removed a significant volume of refining capacity from the global market.

“Now that these refining margins are so extreme, they literally can’t pass it up,” Babin said.

“They’re going to buy crude and they’re going to put product on the market and make money.”

Purchases are unlikely to recover completely to levels seen before the war, according to Amrita Sen, founder of Energy Aspects. Still, she said during an interview with CNBC’s “Access Middle East” that Chinese imports have risen from their depressed spring volumes.

Kpler data shows Chinese crude imports fell to a wartime low near 6 million barrels per day in June.

That represented a decline of almost 50 percent from the 11.5 million barrels per day imported during February.

Imports recovered to approximately 7 million barrels per day during July and August. Matt Smith, director of commodity research at Kpler, said buying this month remains near those levels and is unlikely to increase dramatically while oil trades above $100.

Beijing “is a very savvy buyer and will lean more on inventories and keeping refinery runs in check rather than buying oil in triple digits,” Smith said. That discipline could limit the immediate demand shock, although even a measured return by Chinese refiners would tighten an already strained market.

Another major buffer is rapidly disappearing as emergency stockpile releases approach their expected end.

Global inventories have fallen by 400 million barrels after more than six months of war, according to the United States Energy Information Administration, leaving the market increasingly exposed to further disruptions.

“Summer is over, peace didn’t happen, the war is still going on,” McNally said.

He added that efforts by the Trump administration to calm traders with expectations of peace are producing less impact than they did earlier in the conflict.

“The market’s optimism bias, it’s willingness to sell off on verbal intervention, jawboning about peace being around the corner, seems to be ebbing a little bit,” McNally said.

With inventories shrinking and Chinese demand stirring, the path toward the April wartime peak is becoming increasingly difficult to dismiss.