The US recently conducted a cyberattack against an Iranian military ship that was collecting intelligence on cargo vessels in the Red Sea and the Gulf of Aden, three US officials told NBC News on Thursday.

The cyberattack, which occurred more than a week ago, was part of the Biden administration’s response to the drone attack by Iranian-backed militias in Iraq that killed three US service members in Jordan and wounded dozens of others late last month, the officials said.

The operation was intended to inhibit the Iranian ship’s ability to share intelligence with Houthi rebels in Yemen who have been firing missiles and drones at cargo ships in the Red Sea, the officials said.

One of the US officials with knowledge of the cyberattack said the operation was conducted on an Iranian ship named the MV Behshad.

A spokesperson for the National Security Council declined to comment and referred questions to the Defense Department, which also declined to comment.

The Iranian-backed Houthis have launched a wave of exploding drones and missiles at commercial vessels in the Red Sea and Gulf of Aden in recent weeks, calling it a response to Israel's military operations in Gaza.

In the wake of the uptick in Houthi attacks, the US formed a coalition, made up of more than 20 countries, aimed at safeguarding commercial traffic in the Red Sea from attacks by the Houthis.

In mid-January, with support from other countries, the US and Britain targeted just under 30 Houthi locations with 150 different weapons. The two countries have continued to strike Houthi targets since.

It has long been believed that Iran is planning to use the Houthis to take over Yemen and seize the key strategic port of Aden, which controls the entrance to the Red Sea and ultimately to the Israeli resort city of Eilat.

Iran denies it is backing the Houthis and has also denied Saudi Arabian accusations that Tehran provided the Houthi rebels in Yemen with ballistic capabilities.