NEW YORK (Reuters) - Oil futures rose 1% on Friday, with U.S. crude up 10% in the week and global benchmark Brent gaining 5%, on fears the United States could attack Iran and disrupt flows from the Middle East, which provides more than a fifth of the world’s oil output.

FILE PHOTO: Pumpjacks are seen against the setting sun at the Daqing oil field in Heilongjiang province, China December 7, 2018. REUTERS/Stringer

U.S. gasoline futures, meanwhile, jumped around 4% following a massive fire at Philadelphia Energy Solutions’ refinery in Philadelphia, the largest on the U.S. East Coast.

“The heightening of tensions between the United States and Iran has evolved as primary price motivator in spiking oil values,” Jim Ritterbusch of Ritterbusch and Associates said in a note.

While the rise in U.S.-Iranian tensions has largely driven the crude price gains, analysts said an early July meeting of the Organization of the Petroleum Exporting Countries (OPEC) and its allies to reassess production targets, a potential softening of trade tensions between the United States and China and the refinery fire were also supporting prices.

Brent futures were up 72 cents, or 1.1%, to $65.17 a barrel by 1:20 p.m. EDT (1720 GMT), while the most active U.S. West Texas Intermediate (WTI) crude contract was up 47 cents, or 0.8%, at $57.54.

That put Brent on track to gain about 5% for the week, its first weekly gain in five weeks, and WTI to jump about 10%, which would be its biggest weekly percentage gain since December 2016.

The U.S. benchmark surged 5.4% and Brent jumped 4.3% on Thursday after Iran shot down a drone that the United States claimed was in international airspace and Iran said was over its territory.

U.S. President Donald Trump said he had aborted a military strike on Iran because such a response to Tehran’s downing of the unmanned U.S. surveillance drone would have caused a disproportionate loss of life. [nL2N23S0DX]

Iranian officials told Reuters that Tehran had received a message from Trump through Oman overnight warning that a U.S. attack on Iran was imminent.

The officials said they had responded by saying that any attack would have regional and international consequences. They also said Supreme Leader Ayatollah Ali Khamenei was against talks but that they would convey the U.S. message to him.

Trump spoke on Friday to Saudi Crown Prince Mohammed bin Salman about Middle East stability and the oil market, the White House said, after tensions with Iran prompted a rise in oil prices.

Tensions have been on the rise since U.S. sanctions on Iran severely reduced oil exports from OPEC’s third largest producer and as Washington has blamed Tehran, which denies any role, for a series of attacks on oil tankers in the Gulf.

“There is no doubt that a severe disruption to the transit of oil through this vulnerable route would be extremely serious,” said consultancy FGE Energy in a note.

The demand-side outlook has also improved, with appetite for risk assets rising after the European and the U.S. central banks signaled possible rate cuts this week.

A weaker dollar also supported oil prices, making crude, usually priced in dollars, cheaper for buyers with other currencies. [/USD]

Another macroeconomic factor supporting prices is the plan by Beijing and Washington to resume talks to resolve a trade war that has hit economic growth prospects.

“Trade anxiety has died down, pushing energy prices higher as global growth will not be pressured by a prolonged tariff war,” said Alfonso Esparza, senior market analyst at OANDA.

Concern about slowing economic growth and a U.S.-China trade dispute had pulled oil lower in recent weeks. That came after Brent reached a 2019-high above $75 in April.

U.S. energy firms added one rig this week, increasing the number of oil rigs operating for the first time in the past three weeks. The rig count, however, is on track to decline for a seventh month in a row in June as drillers cut spending to focus more on earnings growth instead of increased output. [RIG/U]