The U.S. Navy intervened to stop the hijacking of a commercial cargo ship by pirates in the Gulf of Aden near Somalia on Sunday, after which two ballistic missiles were fired from Yemen toward the Navy destroyer that responded to the incident, the U.S. military said.

The ballistic missiles were fired from the part of Yemen controlled by Iranian-backed Houthi rebels, according to a statement released by U.S. Central Command, which oversees American military operations in the region. If the missiles were meant to hit the U.S.S. Mason, a Navy destroyer, they fell well short of the mark: They landed in the Gulf of Aden 10 nautical miles from the American ship.

The U.S.S. Mason, and other ships from the U.S.-led counter-piracy task force that operates off the coast of Somalia, responded after the crew of the commercial ship, the Central Park, called for help. The Central Park crew reported they were under attack from an unknown entity, U.S. Central Command said.

When the coalition vessels arrived at the Central Park, they demanded the release of the ship. Five armed people fled from the ship and attempted to flee in the small boat they had used to attack the cargo ship. The U.S.S. Mason pursued the attackers and forced them to surrender, the news release said. Fox News reported the rescue earlier.

Later, at about 1:41 a.m. local time on Monday, more than 16 hours after the initial attack, two ballistic missiles were fired toward the U.S.S. Mason, which was “concluding its response” to the attack at the time.

U.S. officials would not say who was responsible for the attack and if the five-person group was acting under the orders of a state or group. But officials said that they are investigating whether Iran was involved, or if it was an attack unrelated to the regional tensions that have intensified since Hamas’s Oct. 7 attack on Israel, which prompted Israel to launch a war against the militant group in Gaza.

Houthi rebels, who are backed by Iran in the war in Yemen, attacked several commercial vessels last week in the Red Sea — a body of water next to the Gulf of Aden — including the Central Park. The Houthis and other groups backed by Iran, including Hezbollah in Lebanon, have increased attacks on Israel since Oct. 7.

Officials said it is not clear if the attackers were the same group that attempted to take the ship earlier. While the Houthi rebels struck in the Red Sea, the Gulf of Aden where the Central Park was attacked is far from their area of operations. One U.S. official and one former Pentagon official said Iranian involvement in the operation is being investigated.

Zodiac Maritime, the London-based company that manages the vessel, said that the ship and crew are now safe and unharmed but provided few further details. The ship’s crew had issued a distress call on Sunday reporting they were under attack by pirates, as they passed through the Gulf of Aden, about 54 nautical miles off the coast of Somalia, according to Zodiac Maritime. Zodiac Maritime is led by Eyal Ofer, an Israeli-born shipping magnate.