UNITED NATIONS — Russia and the Trump administration clashed in a vote at the United Nations Security Council for the first time on Tuesday, as the Kremlin vetoed a measure backed by the United States and its Western allies to punish Syria for using chemical weapons.

While the Russians had long signaled their intent to block the resolution, which was supported by dozens of countries, the clash offered insights into the big divisions that remain between the Kremlin and President Trump, who has vowed to improve ties.

Russia and China, two of the five permanent members of the Council, blocked the measure. It was the Kremlin’s seventh Security Council veto in defense of President Bashar al-Assad of Syria over the war that has been convulsing his country for nearly six years.

The American ambassador, Nikki R. Haley, who has called chemical weapons attacks in Syria “barbaric,” accused Russia and China of putting “their friends in the Assad regime ahead of our global security” in her blunt rebuke of the vetoes.