Defense Secretary Lloyd Austin said the United States will take "all necessary steps" to defend its troops after a drone attack by Iranian-backed militants in Jordan, despite President Joe Biden's administration's aversion to war with Iran.

Three US soldiers were killed and more than 40 wounded in Sunday's attack. It was the first attack on US troops that resulted in casualties since the outbreak of the Israeli-Hamas war and signaled that tensions in the Middle East could escalate further.

"The president and I will not tolerate attacks on US forces and will take all necessary steps to defend our troops," Austin said ahead of a meeting with NATO Secretary General Jens Stoltenberg at the Pentagon.

'Iran doesn't want war either'

"We are certainly not seeking a war, and frankly we don't see Iran seeking a war with the United States," Pentagon spokeswoman Sabrina Singh told reporters, adding that the Pentagon believes Iran does not want war either.

"We are not seeking military confrontation with the regime," White House national security spokesman John Kirby said, adding that Biden was working on response options.

The US is trying to determine exactly why some 350 soldiers at the base in Jordan, known as Tower 22, were unable to stop the drone.

Two officials said a US drone also approached the base at the same time as the attack drone arrived. One of the officials said the attack drone was flying low, factors that may have contributed to its evasion by defense systems.

Since October 7, US troops have been attacked more than 160 times in Iraq, Syria and Jordan, and warships have been attacked in the Red Sea. 

The attacks are increasing political pressure on Biden to strike directly at Iran, but he is reluctant to do so for fear of triggering a wider war.Experts say the president's options could include targeting Iran's special forces outside or inside Iran and opting for a more cautious retaliatory strike only against responsible Iranian-backed militants.