US navy destroyer
The US navy is sending ships to accompany commercial trade vessels in the Strait of Hormuz US Navy/Reuters

The US navy will accompany American trade ships as they traverse the Strait of Hormuz to prevent interference from Iranian vessels.

The narrow waterway is divided between Iranian and international waters and is the gateway to the Persian Gulf.

The decision to boost security for American commercial ships was made after Iranian naval vessels fired warning shots close to a cargo ship and then detained its crew on 28 April. Iranian vessels also surrounded a US cargo vessel in the same area on 24 April, before letting the ship carry on without further incident.

"Out of an abundance of caution, because of the unpredictability of our Iranian friends, we're now positioned so that, should the Iranians decide that they're going to be stupid, we're ready to respond," a US official said, according to The Wall Street Journal.

The US will not be "escorting'" the ships, which would mean continuously following them while in transit. Instead the "accompanying" US navy vessels will be present when US cargo ships are in transit in the Strait of Hormuz.

In the latest incident, a Marshall Islands-flagged ship was seized due to a court order, according to reports in Iranian media.

The Maersk Tigris was intercepted in international waters, according to its Danish charterer Maersk. The company has learned that an Iranian appeals court has ruled that it must pay $3.6m (£2.3m, €3.2m) for a cargo delivered 10 years ago for an Iranian company based in Dubai. The company said the cargo was never collected and was later disposed of by local authorities.

"The seizure of the ship was solely an enforcement of a judicial court ruling resulting from a commercial dispute between two private parties," the Iranian Embassy in Denmark said in a statement.

"Naturally the ship will be released after settlement of debts by Maersk Shipping Line and will be allowed to sail to its final destination," the statement said.

Tensions in the Gulf have escalated as Washington and Tehran prepare to finalise a nuclear agreement by 30 June. If the parties sign a deal, it could see sanctions on Iran being lifted in return for restrictions on its nuclear programme.