BEIRUT—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.

The...