Oil prices spiked after the U.S. launched a missile strike on a Syrian government target.

U.S. crude futures jumped more than 2% in early Friday trading after President Trump ordered the first direct American military action against the regime of Syrian President Bashar al-Assad. They pared those gains later.

The strike, in which U.S. warships fired 59 Tomahawk cruise missiles at a Syrian government airbase, ramps up uncertainty in the oil-rich and politically unstable Middle East.

"Geopolitics are often big drivers in oil markets," said Greg McKenna, chief market strategist at AxiTrader. "The U.S. strike against a regime that is backed by the Russians, and in a country where the Iranians are active as well supporting the regime has the potential to cause further political ructions."

Related: Trump launches military strike against Syria

The potential reactions from Iran and Russia, both major oil producers, "will keep oil traders on edge," he said. "That uncertainty supports prices ... in the very immediate term."

U.S. crude, which suffered a sharp drop in early March, hit its highest level in a month on Friday. But by midday in Europe, its gains had eased, leaving it trading up just 0.3% around $52 a barrel.

Analysts at JBC Energy Research cautioned that the price spike "could disappear as quickly as it emerged."

Syria itself is not a major oil producer, but the country is uncomfortably close to the Strait of Hormuz -- a critical chokepoint through which millions of barrels of oil are shipped each day. An escalating conflict in the region could affect global supply.

Related: Is OPEC headed for a showdown with U.S. shale

Trump said the missile strike was in response to a chemical weapons attack on civilians earlier this week that the U.S. believes was carried out by the Syrian government.

The U.S. military action drove investors toward assets that are considered safer bets in times of uncertainty, such as gold and the Japanese yen. Gold prices shot up more than 1% to their highest level in nearly five months, while the yen strengthened as much as 0.7% against the dollar.

Stock markets were jittery. Japan's Nikkei, which had been trading up more than 1% before news broke of the U.S. strike, sank into negative territory before regaining some ground. U.S. stock futures were down around 0.1%.

Major European markets edged lower, but London's FTSE 100 index was slightly higher, supported by gains in oil stocks such as BP (BP) and Shell (RDSA).

Matt Simpson, a senior analyst at ThinkMarkets, said the moves "are an understandable reaction, which followed a relatively sleepy week for markets." Attention had previously been mainly focused on Trump's meeting with Chinese President Xi Jinping and the U.S. jobs report.