Maersk's move comes a day after French energy group Total and other European companies signalled they could exit Iran ahead of a reimposition of sanctions following the United States' decision to pull out of the Iran accord.
French President Emmanuel Macron said on Thursday that the European Union must protect European Union companies doing business with Iran from U.S. sanctions.
But Macron, joining EU leaders for a summit in Bulgaria, also said he recognised that big companies would want to protect their own interests.
"International companies with interests in many countries make their own choices according to their own interests. They should continue to have this freedom," he said.
U.S. President Donald Trump's decision to abandon the 2015 nuclear accord with Iran means European countries that have since invested in the country will be at risk once new sanctions come into effect.
Maersk Chief Executive Soren Skou said: "With the sanctions the Americans are to impose, you can't do business in Iran if you also have business in the U.S., and we have that on a large scale."
"I don't know the exact timing details, but I am certain that we're also going to shut down (in Iran)," Skou told Reuters in an interview following Maersk's first-quarter earnings.
MSC, the world's second biggest container shipping group after Maersk, said on Wednesday it would stop taking new booking for Iran.
Other companies which have warned they would wind down business in Iran following reinstated sanctions include German insurer Allianz, Siemens and Danish oil product tanker operator Maersk Tankers, previously owned by the Maersk conglomerate.
Maersk's Skou said higher oil prices which followed the U.S. withdrawal were hitting its container shipping business because of higher bunker fuel prices.
Oil prices hit their highest level since November 2014 on Thursday, with Brent crude creeping ever closer to $80 per barrel.
(Reporting by Stine Jacobsen and Jacob Gronholt-Pedersen; Editing by Jon Boyle and Jane Merriman)