MARRAKESH, Morocco — Diplomats at an annual United Nations global warming summit meeting here expressed shock at the election of Donald J. Trump, who has called climate change a hoax and vowed to withdraw the United States from the Paris climate change accord, worrying that Mr. Trump’s presidency could cripple a decade of climate diplomacy.

And some called for retaliation to compel American compliance. Nicolas Sarkozy, the former president of France, who is again running to lead his country, suggested imposing a carbon tariff on imports from the United States, based on the amount of carbon dioxide pollution emitted to produce various goods.

Salaheddine Mezouar, the Moroccan foreign minister, who is presiding over the Marrakesh meeting, said: “We really want the U.S., naturally. It has a huge role, a huge weight.”

Officials from the Obama administration sought to reassure the world that even if Mr. Trump rolls back the United States’ federal climate change policy, many states and electric utilities have already turned toward investing in the growing market for low-carbon energy.