As news of Donald Trump’s victory reached Marrakech on Wednesday, the many thousands of diplomats, activists, youth and business groups gathered in the city for the UN’s annual climate conference were left in shock and disbelief that the US could elect a climate-change denier as president.

Some of the younger activists were in tears. “My heart is absolutely broken at the election of Trump,” said Becky Chung, a delegate for youth advocacy group SustainUS from California.

“We will see a rising-up of people’s movements committed to mass civil disobedience to keep fossil fuels in the ground. The next four years will be critical. We have to get to zero emissions by 2050,” she said.

The delegates from nearly 200 countries, many of whom had spent 20 years negotiating the complex Paris agreement that aims to limit global warming to a 1.5°C rise, were tightlipped but clearly nervous. The US delegation went into a huddle, meetings were cancelled and talk centred on whether Trump would fulfil his often-repeated threat to withdraw the US from the UN’s Paris agreement – blitzing decades of fraught but ultimately successful global negotiations.

“No one thought this could happen. Everyone here is in shock,” said Bangladeshi scientist and diplomat Saleemul Huq. “No one had anticipated this result and, hence, there was no plan B. We will have to think about what happens next.”

Morocco’s minister of foreign affairs, Salaheddine Mezouar, the meeting’s president, put on a brave face. “We are convinced that all parties will respect their commitments and stay the course in this collective effort,” he said.

But few people agreed with him because Trump has consistently denied 40 years of climate science – and he claims that manmade global warming is a Chinese hoax. Ditching the Paris treaty, he has said, is his number one environmental priority.

Withdrawal from the treaty, which was crafted over years by US diplomats, often against developing countries’ wills, would take four years to complete and would outrage world opinion. Many delegates in Marrakech privately think it more likely that a new US administration would choose to ignore it. Because the Paris treaty is voluntary, the US would face global opprobrium, but no sanctions or fines.

Instead of reducing US emissions by a quarter to 28% below 2005 levels by 2025, as the US has pledged, Trump would support US coal, gas and fracking and halt payments aimed to help developing countries adapt to rising sea levels and temperatures. The result would be to increase US emissions, set back attempts to hold temperatures to a 2°C rise by years and, say businesses and activists, put a brake on the world’s renewable energy industries and consign poor countries to deeper poverty.

The UN, privately rattled but publicly calm in Marrakech, fervently hopes that the reality of power, diplomatic pressure and business self-interest will keep Trump in the fold. At stake, say officials, is not just the treaty but the whole UN system, which is based on consensus between countries.

Erik Solheim, head of the UN environment programme, told the Observer that Trump’s pragmatism and business sense was likely to score over ideology. “It’s clear there is uncertainty because of some of the statements made before the election. But I am certain we have crossed the Rubicon. There is no way back on climate change,” he said.

Should the US leave the treaty, Solheim says that some of the biggest losers would be America’s working people. “They would lose out on all the new green jobs. It would be a huge lost opportunity for the US people. The thinking that climate is a cost is wrong. It is a business opportunity,” he said.

Other diplomats and politicians claim that the US would lose important allies if it chose to become the world’s only climate rogue nation. “Trump has to acknowledge the reality of climate change. He has a responsibility as president-elect now,” said Alden Meyer, director of strategy at the Union of Concerned Scientists.

The deep fear in Marrakech is that US opposition to the Paris agreement would signal to other countries that they need not meet their voluntary pledges, with the result that global emissions would soar and climate change could become unstoppable.

Withdrawal would also undermine relations with China. “Climate co-operation between the US and China will need a new strategy with new priorities and highlights,” said Zou Ji, deputy director general of China’s national centre for climate change strategy.

Developing countries were particularly nervous last week because Trump has also vowed to stop contributions to the Green Climate Fund, set up by the UN to distribute an eventual $100bn a year to help them reduce emissions and adapt their infrastructure to climate change. The US, which is expected to be the biggest contributor to the fund, has pledged $4bn over four years.

Greenpeace international co-directors Jennifer Morgan and Bunny McDiarmid said: “We will not give up. We will work even harder and invite people to join this powerful movement. The stakes for current and future generations are too high and time is too short.”

As the Marrakech meeting prepared to enter its second week, with the arrival of ministers from 200 countries, Jean Su of the US Center for Biological Diversity sought to quell fears: “I do believe that climate progress will not crash and burn because of one single man who was elected yesterday …. One single man cannot ruin a whole 20 years of progress on climate change.”

Michael Brune, director of the Sierra Club, the US’s largest environment group, was adamant. “It would be very difficult for Trump to remove the US from the Paris agreement. If he tries to ... he will run headlong into an organised mass of people who will fight him in the courts, in the marketplace, and in the streets.”