Updated

The climate change agreement between the United States and China caught the world by surprise after months of secret negotiations, built on an opening that arose last year when President Barack Obama and Chinese President Xi Jinping met in the California desert.

The deal, announced Wednesday, could mark a turning point in international negotiations because for the first time it brings together the two largest emitters of heat-trapping gases.

Whether it will actually help clean up the atmosphere and slow the increase in world temperatures remains to be seen. But the agreement clearly signals that Obama intends to charge ahead on the issue in his final two years in office, even though many of Congress' staunchest supporters of action lost in last week's elections.

The U.S.-China deal has its roots in a June 2013 summit at the Sunnylands estate, where Obama and Xi reached an agreement on pursuing the reduction of hydrofluorocarbons that are used in refrigerators and insulating foams. To the White House, the deal suggested a broader openness from China to tackling climate change, senior Obama administration officials told reporters traveling with the president to Asia.

The officials said Secretary of State John Kerry returned from a trip to China in April with the idea of pursuing a joint climate change plan with Beijing. A senior administration official said Kerry worked with his Chinese counterpart, State Councilor Yang Jiechi that launched the U.S.-China Climate Change Working Group. Later, Kerry invited Yang to visit him in Boston, where the former Massachusetts senator used the vista of the Boston Harbor to show how government action can make positive change, the administration official said.

The officials spoke only on condition of anonymity because they were not authorized to comment publicly by name.

The following month, Obama sent Xi a lengthy letter outlining areas where he thought their two countries could find common ground, including climate change, possible military cooperation and trade partnerships.

When Obama and Xi met in the Hague on the sidelines of a nuclear security summit in late March, the U.S. president raised his climate proposal again. But the Chinese leader was noncommittal, the officials said.

It wasn't until September when the U.S. began to feel it was making progress with the Chinese. White House National Security Adviser Susan Rice traveled to China and received a signal from her counterparts that they wanted to proceed on a climate accord. In an effort to generate momentum, Obama met later that month with Chinese Vice Prime Minister Zhang Gaoli on the sidelines of the annual U.N. gathering in New York to press the climate deal.

The officials said Zhang came to the meeting with a message from Xi: Let's get this done. That go-ahead cleared the way for an intensive process that concluded in the days leading up to Obama's visit to Beijing.

The deal was largely finalized ahead of the U.S. president's arrival this week but was kept quiet until Obama and Xi could discuss it over a lengthy dinner in the Chinese capital Tuesday night, officials said. The presidents announced the deal during a joint press conference the following day.

The agreement isn't binding, but it is seen as a signal to the world that the U.S. and China are united on a need to reduce carbon emissions. That could be significant heading into high-stakes international climate negotiations in Paris next year.

The U.S. set a new target to reduce its emissions of heat-trapping gases by 26 percent to 28 percent by 2025, compared with 2005 levels. That's deeper than earlier in Obama's presidency, when he pledged to cut emissions by 17 percent by 2020.

China, whose emissions are still growing as it builds new coal plants, didn't commit to cuts of a specific amount. Rather, Xi set a target for China's emission to peak by 2030, or earlier if possible. He also pledged to increase the share of energy that China will derive from sources other than fossil fuels.

Both leaders have a political incentive in pushing their countries to follow through on the pact.

Xi faces growing public concern in China about environmental quality, particularly from the millions of Chinese who live in large cities overwhelmed by pollution. For Obama, who clearly sees tackling climate change as part of his presidential legacy, the agreement is a way of proving he still has global influence even though his political power at home may be waning following his party's defeats last week.

The agreement does not require congressional approval, although leading Republicans voiced their opposition. House Speaker John Boehner called it "the latest example of the president's crusade against affordable, reliable energy that is already hurting jobs and squeezing middle-class families."

___

Pickler reported from Washington. Associated Press writers Dina Cappiello in Washington and Josh Lederman in Beijing contributed.

___

Follow Julie Pace on Twitter at http://twitter.com/jpaceDC and Nedra Pickler at https://twitter.com/nedrapickler