“Simply saying we are going to do something and then not doing it, to me, then you’re in no man’s land,” Mr. Gallagher added. “That’s where Obama lived for eight years, and it’s a bad place to be.”

At the same time, many Republicans who share Mr. Trump’s often-stated distaste for foreign military entanglements praised the aborted strike as the best possible outcome.

“I am grateful that the president is not eager to lurch into another Middle Eastern regime change, in an endless, unfocused, unconstitutional way,” said Representative Matt Gaetz, Republican of Florida. “President Trump ran as a very different kind of Republican, someone who wanted to end wars, not start them.”

Democrats, too, were uncharacteristically complimentary, although Speaker Nancy Pelosi noted that she had not been informed of the planned strike in advance, a “departure” from past practice, and said any such action must be authorized by Congress.

“A strike of that amount of collateral damage would be very provocative, and I’m glad the president did not take that,” Ms. Pelosi told reporters. “We think there are many options that are not what they call kinetic — that is to say, a strike on the country — that might be more useful.”

A bipartisan group of senators — including Democrats like Tom Udall of New Mexico and Tim Kaine of Virginia and Republicans like Rand Paul of Kentucky and Mike Lee of Utah — plans next week to try to attach an amendment to a sweeping defense bill that would block funding for any military operations against Iran without explicit authorization from Congress.

Representative Adam B. Schiff of California, the chairman of the Intelligence Committee, said Mr. Trump should not be criticized for holding off on military action.