President Donald Trump warned on Wednesday that the United States would destroy Iranian gunboats that harass American ships at sea.

The threat, which contributed to a recovery in oil prices, came days after the Pentagon claimed that ships from Iran's Islamic Revolutionary Guard Corps Navy took "dangerous and provocative" actions near U.S. Navy and Coast Guard ships in the Persian Gulf.

"I have instructed the United States Navy to shoot down and destroy any and all Iranian gunboats if they harass our ships at sea," the president wrote in a post on Twitter.

West Texas Intermediate, the U.S. benchmark, rose more than than 30% on Wednesday after slumping to historic lows this year as the coronavirus pandemic crushed demand. Iran produced 3% of the world's oil last year.

Six U.S. military vessels were conducting training operations in international waters last week when 11 Iranian ships "crossed the bows and sterns of the U.S. vessels at extremely close range and high speeds," according to the April 15 U.S. Navy statement.

At one point, the Iranian ships came within 10 yards of the Coast Guard cutter Maui's bow.

Trump tweet

The U.S. crews issued multiple warnings via bridge-to-bridge radio, five short blasts from the ships' horns and long-range acoustic noise devices to the Iranian ships.