A U.S. attack on Syria would likely dash expectations of progress in nuclear negotiations with Iran and undermine new Iranian President Hasan Rouhani’s call for improving relations with the West, diplomats said.

An attack on Damascus would likely give Iranian hard-liners, who oppose a nuclear compromise, the upper hand over moderate President Hasan Rouhani, who has made foreign policy and nuclear talks a priority.

***

“A direct U.S.-Iran conflict in Syria will only widen the chasm of mistrust needed to be bridged in order to reach a nuclear accommodation,” said Karim Sadjadpour, an Iran expert with Carnegie Endowment for International Peace.

Obama would be bombing Iran’s main ally, strengthening the hand of hardliners in Tehran and undermining Rouhani’s room for maneuver.

***

Officials cautious of intervening say targeted strikes to punish Mr. Assad for using chemical weapons risk triggering a bloody escalation. If the regime digs in and uses chemical weapons again, or launches retaliatory attacks against the U.S. and its allies in the region, Mr. Obama will come under fierce pressure to respond more forcefully, increasing the chances of full-scale war, the officials say.

And, of course, Russia—which has declared that it won’t support an American action against Syria—could up the ante, too, by backing Assad more powerfully in response.