The news that Tehran had fired more than a dozen ballistic missiles against at least two Iraqi military bases hosting U.S.-led coalition personnel broke during a meeting of Democratic lawmakers in the House of Representatives.
The attack was in retaliation for last week's U.S. drone strike killing elite Quds Force commander Qassem Soleimani, according to a statement from Iran's Revolutionary Guards on state TV.
House Speaker Nancy Pelosi was handed a note about the attack during the meeting and left soon thereafter, according to people present.
"Closely monitoring the situation following bombings targeting U.S. troops in Iraq. We must ensure the safety of our service members, including ending needless provocations from the Administration and demanding that Iran cease its violence. America & world cannot afford war," Pelosi said on Twitter.
U.S. President Donald Trump ordered the attack on Soleimani on the grounds that the Iranian general was planning to attack Americans, without providing evidence.
Democrats have been critical of the decision, saying it would escalate tensions with Iran. They have called for Trump to seek approval from Congress before taking further military action, although the Republican-led Senate is unlikely to support any measure that would tie the president's hands.
"At this moment, my heart and my prayers are with our military and their families in Iraq and around the world," Democratic presidential contender Elizabeth Warren said at an event in New York.
"But this is a reminder why we need to de-escalate tension in the Middle East. The American people do not want a war with Iran," she added.
Former Vice President Joe Biden, another candidate for the Democratic nomination to take on Trump in November's presidential election, said at an event outside Philadelphia that the attack was predictable and faulted Trump's handling of the situation.
"I just pray to God as he goes through what’s happening, as we speak, that he’s listening to his military commanders for the first time because so far that has not been the case," he added.
On news of the attack, "there was not surprise in the room," said House Majority Leader Steny Hoyer, who attended the meeting with Pelosi.
"Nobody laments the loss of Soleimani, he was a vicious terrorist that caused a lot of loss of life. But no one ought to be surprised that when you do that, there's a response," he said.
Republican U.S. Senator Marco Rubio called for unity, saying in a Twitter post that Iran wanted Americans to turn against one another .
"The time will come to debate U.S. policy. Tonight American & allied troops have come under direct attack by a nation-state & Americans must come together to support & protect them & respond appropriately," he said.