BAGHDAD — A volley of rockets struck a sprawling military base north of Baghdad Wednesday evening, killing three service members, two of them Americans and one British, according to a United States official and an Iraqi military officer, both in Iraq.

The attack came less than three months after a similar rocket attack killed an American contractor in Iraq, setting off a spiral of attacks that nearly led to war between the United States and Iran.

The two Americans killed Wednesday were active-duty troops with the Army and Air Force, an American military official said. The official said that 12 members of the American-led military coalition in Iraq of various nationalities were wounded in the attack on the base, Camp Taji.

The White House and Pentagon had no immediate comment on the rocket attacks.

A senior Trump administration official said that senior national security aides were closely following the situation but declined to comment further until a more detailed assessment of what happened and who was responsible was available.