Donald Trump's astonishing victory has turned the world of climate action upside down, setting back U.S. environmental policy and threatening the international drive to cut carbon pollution and slow global warming.

The stunning upset by Trump, who has routinely suggested that climate change is a hoax, threatens to unravel President Obama's climate action agenda, built on executive orders and regulations, including the Environmental Protection Agency's carbon clampdown at power plants. Trump has vowed to "cancel" the Paris climate agreement, but could cripple it by merely retreating from the U.S. commitment. As the world's second-biggest emitter of carbon dioxide pollution, the U.S. could render the global treaty meaningless, at a time when scientists are urging nations to quickly raise their ambition, or risk an escalating climate crisis.

Leading up to the election, the gulf between Trump and Hillary Clinton on climate and energy was wide and the stakes couldn't have been higher. But the campaign was not fought on those issues. And despite environmental groups pouring an enormous amount of money and people power into the race, they were unable to break through with the message that climate action is urgent.

The result sent shockwaves through the global climate talks now happening in Morocco, known as COP 22, that aim to turn the Paris agreement's promises into action. Many there expressed deep concern and disappointment.

"We are all stunned at the COP," said Saleemul Huq, a climate expert at the International Institute for Environment and Development. "No one had anticipated this result, and hence there was no plan B. We will have to think about what happens next."

In another disappointing outcome for climate advocates, Republicans maintained their control of the Senate, winning eight of 11 key races, as well as keeping their majority in the House of Representatives. Both chambers are strongly opposed to climate action policies.

The nation's climate leaders were left stunned, somber, angry and reflective. They had already prepped their wish lists for Clinton that included a massive clean energy spending program, a moratorium on fossil fuel leases on federal lands and other rules to curb the coal, oil and gas industry's impact on the atmosphere and water.

Most environmental groups had backed the Democratic nominee, despite reservations among progressives about her all-of-the-above energy approach. In her, they believed they had a leader who understands the risk of climate change and respected the science. Clinton had been challenged from the left by her primary opponent, Sen. Bernie Sanders, but climate activists were confident they would have been able to influence her policy and push her to further commitments to action. Most of all, she wasn't Trump.

Now, with little chance to have their agenda heard in Washington, environmental groups will be forced to play defense. At first, that will mean an effort to block Trump's plans, perhaps by convincing Senate Democrats to block appointments or use the filibuster. Legal challenges are another avenue, but Trump will be able to quickly make his mark on the judiciary, with his appointment of a Supreme Court justice.

Trump has signaled plans to populate his cabinet with oil industry executives and allies, to eliminate the EPA, and to cut all federal spending on the United Nations climate process. Trump has claimed that he will save $100 billion over eight years, which appears to be based on a plan to end federal funding for solar and wind energy, efficiency, batteries, clean cars and climate science, wrote Joe Romm, a former Energy Department official and founder of the Center for American Progress' Climate Progress blog.

Basically, Trump has promised an America-first, drill-baby-drill energy policy. He has promised unfettered production of coal, oil and natural gas and to "bring the coal industry back 100 percent."

Trump said he will rescind any regulations that unduly burden energy development, including the Clean Power Plan, which, if it survives legal challenges, was to have been the cornerstone of Obama's climate action legacy and the main policy for realizing the nation's Paris goals. He also said he would abolish the Waters of the U.S. rule, which the fracking industry in North Dakota has opposed. Trump said he would urge TransCanada to renew its permit application for the Keystone XL pipeline. Within his first 100 days, Trump said he would lift moratoriums on fossil fuel production in federal areas, which could clear the way to new coal leasing in the West as well as coastal oil drilling, not only in the Arctic but also the Atlantic and potentially, the Pacific.

"Western Energy Alliance is overjoyed that we will not be experiencing a third term of the Obama Administration," the industry group said in a statement this morning. "President-elect Trump understands that overregulation is killing American opportunity, and his plans to spur development of domestic shale oil and natural gas will create hundreds of thousands of blue-collar jobs while delivering widespread prosperity and low energy prices for consumers."

Jeff Holmstead, a lawyer who represents coal-burning utilities and who spent four years as an assistant administrator in the EPA under President George W. Bush, said that if the courts don't kill the Clean Power Plan, Trump will have a number of other options. "I think it's certain the Clean Power Plan will be revoked," he said this morning. "The only question is how."

For his energy and environmental policy team, Trump has selected one of the nation's most prominent climate contrarians, Myron Ebell of the Competitive Enterprise Institute, to head his EPA transition. Ebell worked on policy for the tobacco industry before his years of work opposing environmental regulations and sowing doubt on climate science. Trump is also reported to be considering Harold Hamm, chief executive of fracking industry leader Continental Resources, for energy secretary, and Forrest Lucas, co-founder of oil products company Lucas Oil, for interior secretary.

Long-term, the environmental movement faces soul-searching about its own direction, and how to turn widespread popular support for environmental protection into an effective political force for urgent climate action.

Michael Brune, executive director of Sierra Club, said this morning that he was feeling "angry and sad and contemplative."

Looking to the future, he said, "I think it starts with being thoughtful about how we got into this position, and how fear played a role in this election, and looking at how do we build a stronger, broader, more powerful coalition to get the solutions we need.

"We have an opportunity to show climate solutions work for all Americans, including low-income white folks as well as communities of color all across the country."

Brune said green groups will also have to remain on offense, in addition to resisting Trump's plans. "We've made tremendous climate and clean energy progress, and that can't be stopped, even with a united climate-denying federal government."

Brune pointed to state and city governments choosing renewable energy over coal, and the efforts of private companies on climate change, as well as popular support for action on climate change. "Trump, McConnell and Paul Ryan, all working together, can't stop that," he said. "The best lever that we have is a majority of the voting public that believes that climate change is real and we need to do something about it. The Republican leadership will expose themselves politically if they overreach."

Clearly, though, the early battle lines will be Trump's regulatory proposals.

"If his goal is to dismantle EPA, then our job is clear," said Jeremy Symons, associate vice president for climate policy affairs at the Environmental Defense Fund. "It's to protect the bedrock environmental laws like the Clean Air Act and Clean Water Act that have been at the heart of America's environmental progress, and it is to mobilize the public, who overwhelmingly support the EPA and these laws."

Symons said he believes that the industry would rue the demolition of the environmental protection architecture that Trump has promised. "I think the election should be a wake-up call to businesses, who now face a future of regulatory chaos if President-elect Trump tries to follow through on dismantling the regulatory framework that protects the air we breathe and the water we drink," he said. "The fact of the matter is that our environmental laws work. And any attempt to roll back these laws will create regulatory chaos for business and will precipitate a backlash from the public."

Trump will be the only world leader who rejects climate science, according to a study by the Sierra Club. This is a particularly tough pill for climate activists to swallow.

"Trump's election is a disaster, but we must channel our anger and fear into hope and resolve. Our work becomes much harder now, but it's not impossible, and we refuse to give up," said May Boeve, executive director of the climate advocacy group 350.org. "We refuse to leave the future of our climate in Trump's hands. Now is the time to take a deep breath and fight like never before."

"Our hearts go out today to the millions of people who voted against bigotry and hate and now have to accept the fact that the man who ridiculed and threatened them for months is now President-elect of the United States," said Greenpeace USA Executive Director Annie Leonard. "Greenpeace and millions of people around the world have all the power we need to combat climate change and create a just world for everyone. Let's use this moment to reenergize the fight for the climate and the fight for human rights around the world."

The movement's defeat went far deeper than just the presidential race.

The League of Conservation Voters, which gave Clinton its earliest presidential endorsement ever, and spent a record $45 million to elect her and pro-climate action members of Congress, watched four of its five preferred Senate candidates and five of its seven House candidates lose. LCV's only winning Senate candidate was Catherine Cortez Masto of Nevada, who will take the seat of retiring Senate Minority Leader Harry Reid, becoming the first Latina in the Senate.

Opposite LCV in many of the races was the political network of the billionaire libertarian Koch brothers, which stayed mainly out of the presidential race, but spent at least $44 million on down-ballot contests. Seven of the eight Koch-backed Senate candidates were victorious; the network's only loss was to Masto. The Koch brothers' effort was bolstered by massive spending by the U.S. Chamber of Commerce and other conservative and anti-regulatory organizations, including the National Rifle Association.

InsideClimate News reporter Zahra Hirji contributed reporting.