Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Iran said on Thursday that its seizure of a cargo ship owned by the Danish shipping company Maersk was related to a years-old debt. The company insisted that Iran let the ship go.

In a statement, the Iranian foreign ministry said that Iran was following international law, and hoped the ship would be released “once debts have been settled, and hopefully the ship can carry on its course.”

The statement said that the 24 crew members aboard the ship, the Maersk Tigris, were in good health and had access to diplomatic channels.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Iran detained the ship, which carries the flag of the Marshall Islands, on Tuesday in the Strait of Hormuz, off the Iranian coast. The United States sent military vessels to monitor the situation.

Maersk had chartered the ship, which is owned by undisclosed private investors. The company met with Iran on Wednesday.

Maersk said it had agreed to pay an Iranian company $163,000 after an Iranian court ruling in February that was related to a dispute about 10 container boxes transported to Dubai in 2005. Iran has appealed, seeking more money, Maersk said.

“We must insist that the crew and vessel are released as soon as possible,” Maersk said in a statement. “The crew is not employed by Maersk Line, nor is the vessel owned by Maersk Line. Maersk Tigris and its crew are thus not in any way party to the case.”

IN-DEPTH

— Ali Arouzi and Alexander Smith with Reuters