Speaking later with reporters aboard Air Force One as Mr. Trump headed to Florida, Ms. Sanders added that “the president has been clear that he’s going to be tough on Russia, but at the same time he’d still like to have a good relationship with them.”

Another White House official, who spoke on condition of anonymity to describe internal deliberations, said Mr. Trump had decided not to go forward with the sanctions. Mr. Trump concluded that they were unnecessary because Moscow’s response to the airstrike was mainly bluster, the official said.

Russia analysts said the whipsaw policy shift once again highlighted an administration struggling to find a coherent and consistent voice in dealing with Russia, which in the past four years has annexed Crimea, intervened in eastern Ukraine, sought to influence the American election in 2016, allegedly poisoned a former Russian spy living in Britain and propped up the murderous government of President Bashar al-Assad in Syria.

Mr. Trump has mostly spoken hopefully of his efforts to forge a friendship with President Vladimir V. Putin of Russia, including congratulating him on a re-election widely denounced as a sham and even suggesting a White House meeting. At the same time, the Trump administration has imposed two rounds of sanctions against Russia in the last month, expelled 60 of Moscow’s diplomats and closed a consulate in retaliation for the poisoning attack in Britain.

“Trump seems to think that if he accepts what his advisers recommend on even days of the month and rejects their recommendations on odd days, the result will be a strategy,” said Stephen Sestanovich, a scholar at the Council on Foreign Relations and Columbia University who served as ambassador to former Soviet states in the 1990s.