Quitting the Paris Agreement, as President Donald Trump has decided to do, will have steep political and economic costs.

But for an embattled president, it does offer one benefit: It fulfills a campaign promise popular with his base and appeases the members of his administration who are ideologically opposed to anything that smacks of globalism or environmentalism.

There’s been a simmering tension in Trump’s administration on this front. On one side were advisers like Steve Bannon, who believe that climate science is fiction and that a global pact to deal with rising emissions is a Trojan horse for a United Nations takeover. On the other were people like Secretary of State Rex Tillerson and National Economic Council Director Gary Cohn, who actually saw an upside for businesses in staying in the deal.

The United States now joins Syria and Nicaragua as the only nations not to participate in the historic accord. The U.S. had taken a lead role in brokering the agreement, and leaving it is a deeply isolationist move that could weaken the nation’s bargaining power in other agreements.

As America retreats, China is primed to become the new moral leader on this issue. In mid-May, President Xi Jinping announced a $900 billion fund to invest in infrastructure and clean energy projects abroad.

The economic consequences for the U.S. could be worse. The United Nations predicts that the U.S. will lose jobs in the rapidly growing clean energy industry ― estimated to be worth $6 trillion by 2030 ― to Europe, India and China. Countries that tax emissions may put tariffs on American-made imports. And big companies that expect the U.S. will have to regulate carbon eventually are likely to see ditching the deal as only delaying the inevitable, while also sowing the sort of instability that investors don’t like.

Trump’s decision also defies the desires of many major corporate and fossil fuel interests. Oil giants including Exxon Mobil Corp. and Royal Dutch Shell pleaded with the administration to stay in the deal, as did coal producers and corporate behemoths such as Walmart, General Mills and DuPont, all of which operate internationally.

The deal is popular with the public. Sixty-one percent of Americans said the U.S. should stay in the deal while just 17 percent supported backing out, according to a HuffPost/YouGov poll taken in May. Even ousted Fox News pundit Bill O’Reilly urged Trump to keep the U.S. in the pact last November.

But by canceling the deal, Trump makes good on a 2016 pledge, appeasing ardent supporters and a small group of donors. He also wins the approval of a handful of congressmen who made their names railing against widely accepted science.

“What we’re seeing is Trump being true to what got him elected, which is playing to a particular segment of the population,” said former Rep. Bob Inglis (R-S.C.), now the executive director of the conservative environmental advocacy group RepublicEN. “He’s dancing with those who brung him. That’s the one thing that I think he understands.”

Trump hyped the announcement of his decision on the Paris pact for days before the actual announcement. The U.S. cannot officially begin the process of pulling out until November 2019 under the terms of the deal.

I will be announcing my decision on the Paris Accord over the next few days. MAKE AMERICA GREAT AGAIN! — Donald J. Trump (@realDonaldTrump) May 31, 2017

Taking the U.S. out of the U.N. Framework Convention on Climate Change would be the fastest and most drastic way to scrap the Paris Agreement, as it would completely withdraw the country from international talks on global warming. Trump earlier instructed the Environmental Protection Agency to draft plans to withdraw from the Paris Agreement, but said nothing of the UNFCCC, according to a report Wednesday from the London-based nonprofit Responding to Climate Change.

Trump has already axed policies that are key to meeting the U.S. targets for reducing greenhouse gas emissions under the Paris Agreement and outlined plans for an aggressive increase in fossil fuel production over the coming years. The voluntary accord obliges its signatories to come together every five years to set new, more ambitious goals in hopes of capping global warming at no more than 3.6 degrees Fahrenheit above pre-industrial temperatures. Withdrawing cements the fact that the U.S. will go it alone, come what may.

“I see this as mostly an exercise in honesty,” said Josiah Neeley, director of energy policy at the conservative think tank R Street Institute. “It would have been inauthentic for the administration to stay in. It’s not true to them, it’s an honest assessment of where they want to go and what the country is going to do regardless.”

Deciding whether the nation should leave the accord split the White House into two camps.

In a twist, Secretary of State Tillerson reportedly acted as one of the “adults” in the Cabinet, advocating for pragmatic market incentives to reduce emissions, such as a tax on carbon. Tillerson is an authority on climate policy from his nearly four decades at Exxon Mobil, and the company is a top funder of climate science denial.

Debbie Hill/POOL/Reuters Ivanka Trump reportedly pressured her father to stay in the historic Paris climate pact.

The side that opposed the climate deal took a more radical, ideological approach fueled by the belief that the overwhelming consensus among climatologists that the Earth is warming due to human activity is a conspiracy.

One of the foremost advocates for withdrawal appeared to be chief strategist Bannon, a doctrinaire nationalist skeptical of global alliances like the United Nations and the European Union. The withdrawal camp also included EPA chief Scott Pruitt, who in his previous post as Oklahoma’s attorney general sued the EPA more than a dozen times and cultivated such close ties to a gas company that he once allowed its lawyers to send a complaint to the EPA under his letterhead.

They were joined by Attorney General Jeff Sessions, who has said it’s unfair for the U.S. to fund renewable energy development in poor countries based on a theory; a handful of House Republicans; and 22 GOP senators who said staying in the Paris Agreement made the administration vulnerable to lawsuits by environmentalists.

Asked to ascribe motivations to that group, George Frampton, co-founder of the Partnership for Responsible Growth, a D.C.-based conservative group advocating for a carbon tax, chortled: “You want me to psychoanalyze Steve Bannon?”

“It’s a refusal to engage in the fact that we are in a global economy and a set of global relationships,” Frampton said. “Working together with other countries on climate change is actually a tremendous economic and competitiveness opportunity. But in the same way that they don’t see working with allies on a lot of other things is in our best interest and represents leadership, they don’t see applying the same lesson to climate change.”

Olivier Douliery/Pool/Getty Images President Trump has said he believes climate change is a hoax invented by the Chinese to make U.S. manufacturing less competitive.

By leaving the Paris Agreement, Trump plays to a handful of “thought leaders on the right,” said Joseph Majkut, director of climate policy at the libertarian think tank Niskanen Center.

“The America-first, nationalistic narrative is satisfied by pulling out of the Paris Agreement, which is a non-binding, cooperative agreement,” Majkut said. “There’s no real policy win that comes of this. It’s purely a political symbol.”

Early in any administration, the push to achieve campaign promises can be a grounding narrative, particularly for a White House faced with high-profile failures. The House bill to repeal and replace the Affordable Care Act has paltry public support and could be difficult to pass in the Senate. And Trump’s temporary ban on travelers from several Muslim-majority countries has been struck down by every judge it has come before.

“It’s easy to see him viewing this as a victory,” Majkut said. “He stumbled in achieving a lot of campaign promises, this is one that doesn’t require congressional consent, and a judge can’t get in the way.”