WASHINGTON — President Donald Trump told his top national security advisers last week that because of the coronavirus pandemic he didn't think an aggressive response to new attacks on U.S. troops in Iraq by Iranian-backed militias was the right move, according to one former and four current senior U.S. officials.

Trump expressed concern that hitting back hard at Iran at this time would make the U.S. look bad given the extent to which Iran and the rest of the world are struggling to contain the spread of COVID-19, the officials said. They said the president made the comments during a meeting at which his advisers briefed him on possible military responses to the attacks.

It was a notable shift for a president who has made a bellicose approach to Iran a cornerstone of his foreign policy agenda and one that showcases how consumed Trump now is with the coronavirus pandemic.

Full coverage of the coronavirus outbreak

Just two months ago, Trump authorized a controversial operation to assassinate a top Iranian general after Iranian-backed militias killed an American contractor in Iraq. And since taking office, he has tightened U.S. sanctions on Iran and repeatedly threatened military action, once warning that "if Iran does something, they'll be hit like they've never been hit before."

The White House did not respond to a request for comment.

Iran has been one of the countries hardest hit by coronavirus. State media warned Tuesday that millions of Iranians could die from COVID-19 infection if they don't follow guidance. Already, Iran has reported nearly 15,000 cases and more than 850 deaths, and U.S. officials believe the actual numbers are higher. Several Iranian officials have died from the virus.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

On March 11, the Iranian-backed militia group Kataib Hezbollah fired 30 rockets at Camp Taji, an Iraqi base north of Baghdad where U.S. and coalition troops are based. Two American service members and a British military medic were killed and 14 other people were wounded in the attack. The U.S. military retaliated the next day, launching airstrikes on five Kataib Hezbollah weapons storage facilities around Baghdad.

Friday morning, the commander of U.S. Central Command described the U.S. strikes as intended "to send a clear, unambiguous signal that we will not tolerate this behavior in the future."

"We believe that this is going to have an effect on deterring future strikes of this nature. We've seen in the past what happens when you don't respond," said the commander, Marine Gen. Frank McKenzie. "Now people know that we're not going to tolerate these direct attacks on American or coalition service members, and we're willing and able to respond."

Saturday, the militia group mounted an even bigger attack on Camp Taji, this time attempting to fire 56 rockets at the base. Twenty-five rockets hit the base, but the 31 others never launched. Three U.S. troops were seriously wounded, along with two Iraqi service members.

So far, the U.S. military has not responded. On Tuesday, three days after the attack, Secretary of State Mike Pompeo announced sanctions on nine entities and three individuals "who have engaged in activity that could enable the Iranian regime's violent behavior," saying their actions "provide revenue to the regime that it may use to fund [activities], such as the recent rocket attacks on Iraqi and Coalition forces located at Camp Taji."

Download the NBC News app for full coverage and alerts about the coronavirus outbreak

The lack of a military response also comes as Iran furloughed a U.S. prisoner, Michael White, to the Swiss Embassy in Tehran on medical grounds. He was furloughed Thursday to undergo medical testing and treatment but will remain in Iran.

The U.S. military is trying to persuade the Iraqi military to partner up to respond to Kataib Hezbollah inside Iraq, according to four U.S. military and defense officials. "We certainly are pushing the Iraqis to go after the perpetrators," a senior defense official said. While the officials concede that Iraq is not likely to engage in kinetic strikes with the Americans against Kataib Hezbollah, they do not rule out a future response to the weekend attack at Camp Taji.

"The U.S. military is still preparing options," an official said, adding, "I don't believe a decision has been made."

After the March 11 attack on Camp Taji, Defense Secretary Mark Esper told reporters that Trump had "given me the authority to do what we need to do."

A senior administration official said that Trump was briefed by military advisers on various options after the March 11 attack and that the retaliatory strikes are all that's planned in response. "The president has a pretty good sense of what type of action to take in response to these attacks," the official said, adding that the retaliatory measures have been "proportional." The official said that doesn't mean, however, that the U.S. won't take "proactive" actions to prevent another attack, as it did with the strike against Iranian Maj. Gen. Qassem Soleimani.

"We recognize that there's an ongoing threat," the official said. "We don't always have to be counterpunching."

The Trump administration has said the U.S. offered to help Iran with the coronavirus. "We have offered Iran assistance," Trump said last week after the attack in Iraq. At that time, he said that the attack was likely backed by Iran but that the U.S. hadn't yet confirmed that.

National security adviser Robert O'Brien said Monday in an interview on Fox Business that the administration is not distracted by the coronavirus pandemic.

"Our eye is not off the ball," O'Brien said. "While we are focused on corona at home ... we are keeping an eye on those who would do us harm. If anyone thinks America is less determined, they are making a big mistake."

Thursday is the 17th anniversary of the U.S. military invasion of Iraq.