ISTANBUL — An Iranian military commander said Thursday that missiles fired at bases used by U.S. troops in Iraq were not intended to inflict casualties, in the latest sign that Iran was seeking to avoid further escalation of hostilities with the United States.

After more than a dozen missiles slammed into the bases early Wednesday local time, both sides for now appear to be stepping back from further conflict.

“We did not intend to kill,” said Brig. Gen. Amir Ali Hajizadeh, the head of the Revolutionary Guard’s Aerospace Force, according to Iranian state media. “We intended to hit the enemy’s military machinery.”

However, he repeated the government’s claim that “tens of people were killed or wounded.” U.S. and Iraqi officials said the strikes caused no casualties.

Iran and the United States had been on a war footing since President Trump approved the killing last week of Maj. Gen. Qasem Soleimani, the commander of the Revolutionary Guard’s elite expeditionary Quds Force and Iran’s most prominent military leader. Iran retaliated with the missile strike. By Wednesday, Iranian officials were suggesting that Iran did not intend any further attacks, and Trump said he would not respond militarily to the Iranian strikes.

Trump administration officials have offered conflicting justifications for the killing of Soleimani, saying he was targeted to avert an “imminent” threat and otherwise to retaliate against Iranian aggression more generally. Trump, speaking at the White House on Thursday, said that “we did it because they were looking to blow up our embassy.”

It was not clear whether he was referring to previously undisclosed intelligence or to the storming of the U.S. Embassy in Baghdad by supporters of an Iranian-backed Iraqi militia a few days before Soleimani was killed.

“We did it for other reasons that are very obvious,” Trump added, mentioning the killing of a U.S. contractor in a missile strike on Dec. 27.

“We didn’t start it. They started it by killing one of our people and wounding badly other of our people,” Trump said. “So that you call retribution.”

A senior defense official on Thursday said the imminent nature of the attacks Soleimani was planning can be debated.

The official, who spoke on the condition of anonymity to discuss U.S. military operations and intelligence, said there was a history of escalating violence attributed to Soleimani and the Quds Force over time. He described killing Soleimani as a proportionate response to Iran’s aggression and that the administration had considered other options that would have resulted in more casualties. The official didn't elaborate on what those options were.

The official also said, however, that Trump’s claim about the nature of the threat at the embassy were true. He did not say how officials think Soleimani would have carried out such an attack.

The soaring tensions had alarmed officials in Iraq, the main stage for the conflict between Tehran and Washington, and spooked governments throughout the region.

Rocket attacks in Baghdad late Wednesday showed that the risk of escalation remained. The strikes highlighted fears that Iraqi militias, backed by Iran, could pursue revenge for the killing of one of their leaders in the same attack that killed Soleimani.

Two rockets struck Baghdad’s Green Zone, which hosts the U.S. Embassy and other foreign diplomatic missions, but caused no injuries, Iraqi authorities said.

Jawad al-Talibawi, a spokesman for the network of Iraqi militias known as the Hashd al-Shaabi, or Popular Mobilization Forces, told the Iraqi News Agency that the network was not responsible for the attack.

“The bombing of the Green Zone might be an individual reaction, or an attempt by some parties to distort the reputation of the Hashd and shuffle the cards,” he said. “We are calling on those behind the bombing to stop these actions that distort the reputation of Hashd factions.”

The statement was part of the broader effort to de-escalate tensions, but “we should all take a moment before popping the champagne,” Rand Corporation political scientist Ariane M. Tabatabai said in an email. Even as the violence abated, the Trump administration was “doubling down on the maximum pressure campaign, which got us here to begin with,” she said, referring to U.S. sanctions and other measures aimed at isolating Iran.

And Tehran, she added, could take further action. A tweet by Iranian Foreign Minister Javad Zarif that his government had “concluded” its military response “could mean a lot of things: It could mean that Iran is done for now, which is the interpretation many have chosen to embrace. But it could also mean that this specific operation is done. Others may be in store.”

Iran tried to counter the United States on the diplomatic front Thursday after Trump called on Britain, Germany, France, Russia and China to “break away from the remnants” of the 2015 nuclear deal Iran struck with world powers. Trump withdrew the United States from the deal in 2018.

British Prime Minister Boris Johnson, speaking with Iranian President Hassan Rouhani on Thursday, “underlined the UK’s continued commitment to” the nuclear deal and “ongoing dialogue to avoid nuclear proliferation and reduce tensions,” according to a British government statement.

Rouhani also called European Council President Charles Michel asking for a response to U.S. sanctions, which Rouhani described as “economic terrorism,” the Iranian Fars News agency reported.

In a statement, Michel emphasized the need for de-escalation in the region.

The tensions have continued to affect the main mission of U.S. forces in Iraq — fighting the Islamic State. The coalition said in a statement Thursday that military operations against the extremist group in Iraq would remain “paused” while the coalition focuses on “protecting the Iraqi bases that host Coalition personnel.”

The conflict between the United States and Iran sparked concern that operations against the Islamic State, or ISIS, would be sidelined at a moment when the extremists, driven from the vast swath of territory they once held, are trying to regroup in parts of Iraq and Syria.

In Iraq, hundreds of Islamic State fighters have made their way to rural areas in the north, stepping up their attacks in recent weeks, including ambushes and mortar strikes.

U.S. military officials first announced the suspension of anti-Islamic State operations Sunday, as the Trump administration braced for possible Iranian attacks on military bases hosting U.S. troops in Iraq.

The same day, Iraq’s prime minister urged parliament to take “urgent measures” to force the withdrawal of foreign forces after the killing of Soleimani.

Lawmakers responded by passing a nonbinding resolution calling on the government to end the foreign troop presence in Iraq.

The coalition’s statement Thursday said it was awaiting “further clarification on the legal nature and impact of the resolution on foreign troops no longer being allowed to stay in Iraq.” Its training and support of troops fighting the Islamic State has been suspended, although other activities, including countering the militant group’s propaganda, would continue, the statement said.

Dadouch reported from Beirut. Louisa Loveluck and Mustafa Salim in Baghdad, William Booth in London and Dan Lamothe in Washington contributed to this report.