And then there were two.

Nicaragua has announced that it will join the Paris climate accord, leaving only two countries that have either not joined the deal or signaled their plans to leave it: Syria and the United States.

The deal, reached in December 2015 under President Barack Obama, was a major diplomatic achievement for him, committing almost every country in the world — 195 in all — to reduce their emissions of greenhouse gases, a leading cause of climate change. It was the first agreement of its kind.

But, in June, President Trump said in a Rose Garden speech that the United States would withdraw from the accord, fulfilling one of his frequently repeated campaign promises. Mr. Trump had long argued that the agreement was excessively onerous and hampered American businesses.

Nicaragua, however, was critical of the deal as insufficiently ambitious. In a 2015 interview with the news program Democracy Now, Paul Oquist, Nicaragua’s chief climate negotiator, said the accord would not do enough to avert a potential temperature increase of three degrees Celsius.