WASHINGTON — President Trump warned on Wednesday that he would not tolerate the “heinous” chemical weapons attack in Syria, opening the door to a greater American role in protecting the population in a vicious civil war that he has always said the United States should avoid.

The president declined to offer any details about potential action. But he said his horror at the images of “innocent children, innocent babies” choked by poison gas in a rebel-held area of Syria had caused him to reassess his approach. Only days after the White House declared it would be “silly” to persist in trying to oust President Bashar al-Assad of Syria, Mr. Trump said, “My attitude toward Syria and Assad has changed very much.”

“It crossed a lot of lines for me,” the president declared at a news conference in the Rose Garden, referring to the “red line” that his predecessor, President Barack Obama, had drawn before a 2013 poison-gas attack by Mr. Assad’s forces. Mr. Obama’s failure to strike Syria after that, Mr. Trump claimed, sowed the conditions for this new assault. The estimated death toll was reported to have exceeded 100.

Syria was one of several places, along with North Korea and Iran, where Mr. Trump on Wednesday threatened a forceful American response. But in all these cases, he declined to disclose options, arguing that there was a need for surprise but stoking worries that his fledgling administration is not ready to deal with multiple threats across the Middle East and Asia.