Analysts said the limited nature of the strike probably would not compel Russia or Iran into taking significant action.
“The Russian and Iranian responses will likely be shrill rhetorically, but direct responses are unlikely,” said Dennis Ross, a longtime Middle East expert who has worked for several presidents and is now at the Washington Institute for Near East Policy. “The targets struck were tied to C.W. infrastructure,” he added, meaning chemical weapons, “and not the bases where the Russians and Iranians are.”
Mr. Ross said it was possible that Iran could respond indirectly by using Shia militias against American forces in Iraq or possibly Syria but even that he said was “less likely because of the limited nature of this attack.”
In the hours and days leading up to the strike, the potential consequences consumed officials meeting at the Pentagon, in the White House Situation Room and at Fort Meade, Md., where United States Cyber Command is situated.
American officials doubted that Russia or Iran would counterattack directly against United States forces in the region. But they focused on the prospect of an asymmetric retaliation that would rely on Moscow and Tehran’s formidable cyberabilities — one that would be harder for Washington to prepare for, or defend against.
There was no immediate intelligence that such an attack was being planned. It was also uncertain how much either Russia or Iran would take the risk of widening the crisis in Syria with a cybercounterattack on the West.
But American officials said they were girding to respond to a range of possible acts of retaliation — including an online strike that could block communications to United States troops in combat zones.
The heated language in the days before the strike focused as much, if not more, on Russia than on Syria, underscoring the dangers of a spiral into a more dangerous confrontation between the two former Cold War adversaries.
Hours before the strikes began, Nikki R. Haley, the American ambassador to the United Nations, engaged in a scathing exchange with her Russian counterpart at a Friday meeting of the Security Council.
The Russian ambassador, Vasily A. Nebenzya, accused the United States and its allies of reckless warmongering. Mr. Nebenzya said that there was no confirmed evidence that chemical weapons had been used in Douma and that the United States and its allies had “demonstrated they have no interest in an investigation.”
Mr. Trump’s threats of a strike on Mr. Assad’s forces, Mr. Nebenzya said, were “unworthy of a permanent member of the Security Council.”
Ms. Haley said she was incredulous at Mr. Nebenzya’s defense of the Syrian government and his overall portrayal of events. “I’m in awe of how you say what you say with a straight face,” she told him.
For all that, Russia loomed large in the discussions back in Washington about how to proceed. During an American military video conference call, several officials expressed concern about the possible Russian reaction to a strike on Syrian facilities, particularly in light of Moscow’s threats to shoot down incoming missiles.
During the call, military officials said that it was imperative to take steps to protect American Navy destroyers from Russian counterattacks. But a potential online strike loomed as a possibility — and a way for Russia and Iran to sidestep a direct confrontation with the United States military.
Just weeks ago, the Department of Homeland Security identified Russia as the source of malware “implants” in the American electric grid and released samples of code to utilities to help them clean out their systems. The warning accused Russia of mounting a series of intrusions against American and European nuclear power plants and water and electric systems, in what analysts interpreted as a move to test Moscow’s capacity.
Iran hit American banks with a major denial of service attack nearly six years ago, and tried — unsuccessfully — to manipulate a dam in Westchester County, N.Y. Iran is among the most sophisticated midsize powers in using cyberweapons, skills that the country has invested in heavily since the United States and Israel conducted a crippling online attack on its nuclear enrichment sites.
As he prepared the military for retaliation, Mr. Mattis also warned of a potential propaganda counterattack by Syria, Russia and Iran after a Western strike. Defense Department officials underscored the need to show the world convincing evidence that Mr. Assad’s government indeed initiated a chemical attack in Douma.
Russian troops and mercenaries are deployed to Syria, and Iranian forces and militias are also in the country, and could retaliate against the thousands of American troops in Syria and Iraq. United States personnel in Erbil, a Kurdish city in northern Iraq, were readying for a potential Iranian attack on their forces there, according to an American official.
With days of warning that Mr. Trump planned to take action, Syria moved some of its aircraft to a Russian base in hopes of deterring Americans from attacking there — and, in turn, igniting aggressions between the two Cold War powers. Mr. Trump made sure not to target that base on Friday, averting the chance of hitting Russian targets but also sparing the Syrian air force.
Senator Lindsey Graham, Republican of South Carolina, said hours before the strike that he was concerned that the military leadership was being too cautious. “I’m worried whether or not we have the right generals with the right mind-set,” he said on Fox News Radio.
“If our military leaders are listening to Putin and we back off because Putin threatens to retaliate, that is a disaster for us throughout the world,” he added. “You can’t let one dictator tell you what to do about another who has crossed two red lines.”