U.S. President Donald Trump has authorized the U.S. military to respond to Wednesday's rocket attack in Iraq that killed two American troops and a British service member, the Pentagon said on Thursday.

Defence Secretary Mark Esper and Army Gen. Mark Milley, chairman of the Joint Chiefs of Staff, stopped short of blaming Iran-backed Kataib Hezbollah or naming any specific militia.

But they were clear that they believe Iran backed the fighters who carried out the attack, and warned that all options were on the table.

"I have spoken with the president. He's given me the authority to do what we need to do, consistent with his guidance," Esper told reporters at the Pentagon.

Asked if a U.S. response could include strikes inside Iran, Esper hinted that strikes against the militia itself were the priority.

You don't get to shoot at our bases and kill and wound Americans and get away with it​​​​​​. - U.S. Defence Secretary Mark Esper

"I'm not going to take any option off the table right now, but we are focused on the group — groups — that we believe perpetrated this in Iraq, as the immediate (focus)," he said.

Trump told reporters at the White House it was not "fully determined it was Iran" and declined to say what the United States might do.

"We'll see what the response is," he said.

The United States has repeatedly and publicly warned that killing Americans overseas constituted a red line that would trigger a U.S. response.

"We gotta hold the perpetrators accountable. You don't get to shoot at our bases and kill and wound Americans and get away with it," Esper said.

Washington blamed Kataib Hezbollah for a strike in December that killed a U.S. contractor, leading to a cycle of tit-for-tat confrontations that culminated in January's U.S. killing of top Iranian Gen. Qassem Soleimani and a retaliatory Iranian missile attack that left more than 100 U.S. troops with brain injuries.

In the latest attack, some 14 U.S.-led coalition personnel were wounded, including American, British, Polish and others. Private industry contractors were among the wounded. Milley said five of the wounded were categorized as "urgent," suggesting serious injuries that could require rapid medical evacuation.

Likely culprit?

Earlier on Thursday, U.S. Marine Gen. Kenneth McKenzie, head of the military's Central Command, noted that only Iran-backed Kataib Hezbollah had been known to wage such an attack in the past.

"While we are still investigating the attack, I will note that the Iranian proxy group Kataib Hezbollah is the only group known to have previously conducted an indirect fire attack of this scale against U.S. and coalition forces in Iraq," McKenzie told a U.S. Senate hearing.

The U.S.-led military coalition in Iraq says 18 107-millimetre Katyusha rockets struck Iraq's Taji military camp.

A U.S. official, speaking on condition of anonymity, said a total of 30 of the rockets were fired from nearby trucks and that only 18 of them landed at the Iraqi base.

Milley said the truck yielded evidence about those responsible.

A truck loaded with Katyusha rockets is seen in Rashidiya after ten rockets struck the Taji military camp, which also houses U.S. forces, north of Baghdad, Iraq in this undated picture. (Iraqi Media Security Cell/Reuters)

"We have good indication based on forensics of where (the attack) was fired from, who did the firing and so on and so forth," Milley said, adding that "we have pretty good confidence we know who did this."

In a sign of concern that tensions between the United States and Iran could be headed toward open conflict, the Democratic-led U.S. House of Representatives passed legislation on Wednesday to limit Trump's ability to wage war against Iran.

The Republican president has been engaged in a maximum-pressure campaign of renewed sanctions and near-constant rhetoric against Iran, after pulling the United States out of the international nuclear deal reached during the administration of his Democratic predecessor, Barack Obama.

Tensions between Washington and Tehran have mostly played out on Iraqi soil in recent months.

Iran-backed paramilitary groups have regularly been rocketing and shelling bases in Iraq that host U.S. forces and the area around the U.S. Embassy in Baghdad.