The Iranian Port and Maritime Organisation has said that Maersk Tigris container ship was arrested according to the Legal Court of Tehran over a longstanding commercial dispute.
A statement from the organisation said that the verdict was issued according to the legal claim by a private company named Pars Talaee Oil Production against Maersk.
Iranian Foreign Minister Javad Zarif was quoted by Reuters as saying: "The Persian Gulf is our lifeline. We will respect international navigation.
"For us, freedom of navigation in the Persian Gulf is a must."
Zarif added that the legal proceedings on that case had been going on for some 14 years, in which Maersk was required to pay damages on the basis of a court order.
Earlier, Iranian patrol boats took the Marshall Islands-flagged cargo vessel into custody when it was in Iranian territorial waters transiting inbound in the Strait of Hormuz, between the Persian Gulf and the Gulf of Oman in the Arabian Sea.
Following the incident, the US sent an Arleigh Burke-class guided-missile destroyer to monitor the situation, creating tension between both the countries.
According to Pentagon spokesman army colonel Steve Warren, US Naval Forces Central Command (Navcent) received a distress call from the vessel after an Iranian Navy ship fired shots across its bridge and Iranian personnel boarded the vessel.
The US has full authority and responsibility for security and defence of the Marshall Islands under the terms of an amended compact that entered into force in 2004.