Senator Marco Rubio, Republican of Florida, said on Twitter that Mr. Trump had “exercised admirable restraint while setting clear red lines & the consequences for crossing them.”

The Quds, Mr. Rubio tweeted, “are entirely to blame for bringing about the dangerous moment now before us.”

But Democrats worried about the consequences of the strike.

Representative Seth Moulton, Democrat of Massachusetts, called General Suleimani an “enemy of the United States with American blood on his hands.”

“But the question we’ve grappled with for years in Iraq was how to kill more terrorists than we create,” Mr. Moulton said in a statement. “That’s an open question tonight as we await Iran’s reaction to Donald Trump’s escalation, which could ignite a regional war, with still no strategy from the administration.”

Other lawmakers, like Senator Tom Udall of New Mexico, accused Mr. Trump of bringing the nation “to the brink of an illegal war with Iran.”

“Such a reckless escalation of hostilities is likely a violation of Congress’s war-making authority — as well as our basing agreement with Iraq — putting U.S. forces and citizens in danger,” Mr. Udall said in a statement, “and very possibly sinking us into another disastrous war in the Middle East that the American people are not asking for and do not support.”