Iran-backed militias are becoming more audacious in attacking U.S. personnel in Iraq, with rocket strikes against military bases occurring more frequently and, for the first time, in broad daylight.

U.S. officials say they are receiving near-daily reports of “imminent” attacks planned against U.S.-linked military or diplomatic facilities.

But the question of how to deter further militia strikes without putting troops at greater risk highlights how much American security and influence have evaporated in Iraq. In the two weeks since the U.S. carried out bombing raids outside Baghdad to avenge a rocket attack north of the capital that killed a Briton and two Americans, the Trump administration has been wrestling with what additional steps to take to confront the militias without sparking costly retaliation.

Assistant Secretary of State for Near Eastern Affairs David Schenker told reporters last week that the U.S. would “take what steps that we see necessary” to retaliate for militia violence. But the administration remains divided over how, or even when, to strike back.

“This may ultimately come down to how much risk the president is willing to accept in Iraq before our presence there becomes too much of a burden,” said a U.S. official.

Meanwhile in Iraq, where more than 5,000 U.S. troops are potentially in the crosshairs of Iran-backed militants, American requests that Iraqi authorities track down and prosecute those responsible for rocket attacks have made little headway.

The confrontation between the U.S. and Iran — the main foreign powers active in Iraq — escalated dramatically in early January when a U.S. drone strike in Baghdad killed revered Iranian general Qasem Soleimani and Abu Mahdi al-Muhandis, the most influential figure in Iraq’s militia network.

Although both sides then stepped back from the brink of war, recent rocket attacks — attributed to Iran-backed militias by the Pentagon — could soon spark another cycle of reciprocal violence.

The fatal rocket attacks earlier this month on Camp Taji, a military base north of Baghdad, were blamed by U.S. officials on Kataib Hezbollah, one of the main Iran-backed militias. The U.S. strikes carried out in response were condemned by the Iraqi army, which called it “treacherous,” and an Iran-backed militia group threatened retaliation involving “an eye for an eye.”

Since then, there have been at least four rocket attacks around U.S. military and diplomatic installations, and U.S. officials say they believe it is only a matter of time before more troops are killed or wounded.

“Kataib Hezbollah wants to pay back the Americans for the killing of Muhandis, absolutely,” said a defense official, speaking on the condition of anonymity due to the sensitivity of the issue.

After the deadly rocket strikes on Camp Taji, it is not clear, he said, “if they feel the blood debt’s been paid or they’re just getting started. There are warnings and indicators that Kataib Hezbollah aspires to attack U.S. forces. But they always do.”

Amid what one defense official described as “a lot of chatter about” further militia attacks, the Trump administration is struggling to calibrate its potential response.

Strikes on a broad list of targets, among them sites linked to Iran’s Islamic Revolutionary Guard Corps in Iran and Syria, had been considered by the administration on March 11. But these were swiftly dismissed as likely to prompt greater escalation, according to two individuals familiar with the decision-making that night, speaking on the condition of anonymity.

Describing President Trump’s dilemma, Kirsten Fontenrose, director of the Scowcroft Middle East Security Initiative at the Atlantic Council and a former senior official on Trump’s National Security Council, said that U.S. domestic concerns would play an important role. “My assumption is that the president is going to say: ‘I’m not willing to escalate, to start something in an election year while we have coronavirus at home,’ ” she said.

The U.S. response to future militia attacks could also depend on whether American personnel are wounded or killed, and on the size and nature of the assault. “Where’s the red line? That’s the fundamental discussion,” said the U.S. defense official.

Another militia attack comparable to the assault on Camp Taji, which involved 57 rockets fired by seven quad launchers, would likely provoke a more significant American response than would just a couple rockets, another official said.

Yet another consideration may be the level of confidence the U.S. has in identifying who is behind a particular attack. After the rocket attack on Camp Taji, Britain declined to join the U.S. retaliatory bombing raids because it did not believe the evidence provided by the Americans met the legal threshold to justify a strike against Kataib Hezbollah, according to two officials familiar with the issue. The attack was eventually claimed by the newly announced Usbat al-Thaireen, a group that U.S. officials insist is a likely front for Kataib and other Iran-backed militias.

The prospect of more militia violence is already influencing the U.S. posture in Iraq. More U.S. air defense equipment and personnel have been deployed there, officials said. New air defenses — including C-RAMs and Patriot missile batteries — are expected to be in place in the next week or two.

The U.S.-led military coalition is active in Iraq with the stated goal of fighting the Islamic State. Now that ISIS militants have been largely defeated and Iran-backed militia threats to foreign troops are on the rise, hundreds of coalition personnel have shifted out of smaller military outposts in recent weeks, relocating to larger facilities in Iraq or heading to Syria and Kuwait.

At the same time, the Iraqi government’s suspension of joint training due to the covid-19 crisis has prompted the U.S. to withdraw some military trainers from Iraq.

The U.S. Embassy in Baghdad also said late Thursday that it had ordered nonessential personnel to leave Iraq, citing the security situation and travel restrictions relating to the coronavirus.

The U.S.-led coalition has been looking to the Iraqi government to constrain militia violence, asking that individuals be arrested and prosecuted for rocket attacks.

“This has been going on for several months. We complain, the government doesn't do anything. The militias do it again, the government doesn’t do anything,” said a U.S. government official. “As a government, you ultimately need to be able to demonstrate that you are planning to control your own territory.”

Coalition officials suggested that some progress had been made on arrests, highlighting the detention of the owner of the garage from which the alleged Kataib Hezbollah rockets were fired on Camp Taji.

But a senior Iraqi military official, speaking on the condition of anonymity due to the sensitivity of the matter, described the American request as unrealistic.

“No judge will issue an arrest warrant against a senior militia member if he wants to stay alive,” he said. “Let's be honest. If the militias want to attack the bases, we can’t stop them.”

Loveluck reported from London. Ryan reported from Washington. John Hudson and Ellen Nakashima in Washington and Mustafa Salim in Baghdad contributed to this report.