WASHINGTON — President Trump said Thursday that the United States will withdraw from the Paris climate agreement to reduce greenhouse gases because it would cost American jobs, but he added a signature Trump condition: that he would be willing to renegotiate the agreement on more favorable terms.

“I don’t want anything to get in our way. I am fighting every day for the great people of our country. Therefore, in order to fulfill my solemn duty to protect America and its citizens, the United States will withdraw from the Paris Climate Accord,” he said.

But he quickly added a caveat that the United States would also seek to re-enter the agreement — or some other treaty — on terms that were more favorable to American workers. “So were getting out, but we'll start to negotiate, and well see if we can make a deal that’s fair,” he said.

Trump complained that other countries had attached too many conditions to their voluntary agreements to reduce carbon emissions. China, for example, said it would begin reducing emissions in 2030 — meaning they could continue to build coal-fired power plants every year until then. “In short, the agreement doesn’t eliminate coal jobs, it just takes coal jobs out of the United States and ship them to other countries,” he said.

Trump cast the decision in terms of his campaign promise to put America First, reasserting American sovereignty and rebuffing an attempt by the rest of the world to take advantage of the United States.

“At what point do they stop laughing at us as a country?” he said. “I was elected to represent the citizens of Pittsburgh, not Paris.”

Trump said the deal amounted to a "self-inflicted, major economic wound” for the United States.

He downplayed the impact of carbon reductions to the environment, saying the plan would only result in a few degrees’ difference by the year 2100 — gains that could be wiped out by increased emissions by China.

Trump made the long-awaited announcement in the White House Rose Garden, the same place where President Obama hailed the agreement last year as "a turning point for our planet."

With typical Trumpian flair for building suspense, the president had announced his announcement via Twitter, saying "I will be announcing my decision on Paris Accord, Thursday at 3:00 P.M. The White House Rose Garden. MAKE AMERICA GREAT AGAIN!"

The 197-member climate agreement requires every country to establish ambitious targets to reduce greenhouse gasses. But those targets are largely voluntary, and Trump has already made clear that he views environmental regulations as an obstacle to his goal of creating jobs and ensuring energy independence.

Still, the rest of the world was watching to see how far Trump will go in backing out of the accord. By leaving open the possibility of re-entering the agreement, he ended up on the more moderate end of the range of options the White House had been exploring.

Trump had said he's been lobbied heavily by both sides on the climate agreement. On one side is the economic nationalist wing of his White House, advisers such as Steve Bannon who have called climate change a "manufactured crisis" and who once urged "good global warming skeptics" to leave all the lights in their house on in order to protest the Paris talks.

The decision makes good on a campaign promise to “cancel the Paris Climate Agreement and stop all payments of U.S. tax dollars to U.N. global warming programs.” But Trump has also been known to change his mind, as he did in April with the North American Free Trade Agreement. After anonymous White House officials signaled for days that Trump would withdraw from the trade agreement, the leaders of Canada and Mexico ultimately persuaded him to renegotiate.

Trump's decision came less than a week after he met with world leaders in Sicily, where closed-door discussions included pleas for the United States to stick to the consensus agreed to in Paris in 2015 and consummated last year.

In a separate meeting with Pope Francis last week, the pontiff presented Trump with a gift — a copy of his two-year-old encyclical on climate change known as Laudato Si. Francis, who argues that care of God's creation is part of the church's larger concern for the poor, encouraged "continued participation,” in the climate agreement.

Trump said he hoped to continue American leadership on the environment, but make sure that “the burdens are equally shared among the many nations all around the world.”

Under the terms of the agreement, the earliest a nation can formally withdraw is November 2020 — the same month Trump will run for re-election

Obama had framed the agreement as a key test of American leadership in the world, and issued a fiery statement even before Trump finished his announcement.

"The nations that remain in the Paris agreement will be the nations that reap the benefits in jobs and industries created," Obama said in a statement Thursday. "I believe the United States of America should be at the front of the pack. But even in the absence of American leadership; even as this administration joins a small handful of nations that reject the future; I'm confident that our states, cities, and businesses will step up and do even more to lead the way, and help protect for future generations the planet we've got."