LONDON, April 22 (Reuters) - Oil prices rose 2% on Wednesday, erasing earlier losses after reports of gunfire attacks on at least three container ships in the Strait of Hormuz and a lack of progress in peace talks between the U.S. and Iran.

Brent crude futures LCOc1were up $1.71, or 1.7%, at $100.19 a barrel at 1256 GMT. West Texas Intermediate futures CLc1 were up $1.69, or 1.9%, to $91.36. Both benchmarks climbed about 3% on Tuesday.

At least three container ships were hit by gunfire in the Strait of Hormuz on Wednesday. Iran’s Revolutionary Guards Navy seized two vessels for what it described as maritime violations and transferred them to Iranian shores, the semi-official Tasnim news agency reported.

Iran and the U.S. have imposed restrictions on ships using the strait, which until the Iran war began at the end of February had carried about 20% of global oil and liquefied natural gas supplies.

Earlier, U.S. President Donald Trump said he would indefinitely extend the ceasefire with Iran, hours before it was due to expire. Neither side showed up for peace talks in Pakistan.

The ceasefire announcement appeared to be unilateral, and it was not immediately clear whether Iran, or U.S. ally Israel, would agree to extend the truce, which began two weeks ago.

Elsewhere, Russia will divert oil supplies from Kazakhstan previously intended for Germany via the Druzhba pipeline to other routes starting from May 1, Deputy Prime Minister Alexander Novak said on Wednesday.

Novak said the logistical change was due to “technical possibilities” and had been agreed with Kazakhstan.

Later on Wednesday, the U.S. Energy Information Administration is due to publish weekly inventory data. EIA/S Crude stocks fell by 4.5 million barrels last week, while gasoline and distillate stocks also declined, market sources said, citing American Petroleum Institute figures. API/S

Analysts estimated a 1.2 million-barrel draw of crude for the week ended April 17.

“If the EIA confirms the draws and U.S. weekly exports of both crude oil and refined products remain robust, this will be taken as confirmation that consumers in Europe and the Far East are scrambling to secure oil supplies wherever, whenever, and however they can,” PVM analysts said.

The European Union is considering requiring countries to hold stockpiles of jet fuel, and potentially redistribute it based on regional needs and shortages, Europe’s energy policy chief told Reuters on Wednesday, as concerns mount over possible shortages.

($1 = 0.8520 euros)

(Additional reporting by Stephanie Kelly and Yuka Obayashi. Editing by Barbara Lewis and Mark Potter)

By entering your email and clicking Sign Up, you're agreeing to let us send you customized marketing messages about us and our advertising partners. You are also agreeing to our Terms of Service and Privacy Policy.