U.S. President Barack Obama, left, speaks next to Chinese President Xi Jinping during their joint press conference at the Great Hall of the People in Beijing Wednesday, Nov. 12, 2014. U.S. President Barack Obama, left, and Chinese President Xi Jinping drink a toast at a lunch banquet in the Great Hall of the People in Beijing Wednesday, Nov. 12, 2014. Obama is on a state visit after attending the Asia-Pacific Economic Cooperation summit. AP Photo/Greg Baker, Pool U.S. President Barack Obama, left, returns to his seat as Chinese President Xi Jinping applauds after drinking a toast at a lunch banquet in the Great Hall of the People in Beijing Wednesday, Nov. 12, 2014. Obama is on a state visit after attending the Asia-Pacific Economic Cooperation (APEC) summit. Chinese President Xi Jinping, right, gestures to U.S. President Barack Obama as they arrive at a lunch banquet in the Great Hall of the People in Beijing Wednesday, Nov. 12, 2014. Obama is on a state visit after attending the Asia-Pacific Economic Cooperation summit in Beijing. BEIJING (AP) - A groundbreaking agreement struck Wednesday by the United States and China puts the world's two worst polluters on a faster track to curbing the heat-trapping gases blamed for global warming. With the clock ticking on a worldwide climate treaty, the two countries sought to move beyond their troubled history as environmental adversaries and spur other nations. The U.S., a chief proponent of the prospective treaty, is setting an ambitious new goal to stop pumping as much carbon dioxide into the air through the burning of coal, oil and gas. China, whose appetite for cheap energy has grown along with its burgeoning economy, agreed for the first time to a self-imposed deadline of 2030 for when its emissions will top out. Yet it wasn't clear how either the U.S. or China would meet their goals, or whether China's growing emissions until 2030 would negate any reductions in the U.S. Still, the dual announcements from President Barack Obama and Chinese President Xi Jinping, unveiled Wednesday in Beijing, came as a shock to environmentalists who had pined for such action but suspected China's reluctance and Obama's weakened political standing might interfere. In Washington, Republicans were equally taken aback, accusing Obama of saddling future presidents with an unrealistic burden. In fact, the deal had been hashed out behind the scenes for months. During two days of talks last year at the Sunnylands estate in California, Obama and Xi reached an agreement on pursuing the reduction of hydrofluorocarbons that are used in refrigerators and insulating foams. A few months later, the U.S. and China would finalize the deal to seek the elimination of the potent gases. To the White House, China's willingness to reach an accord on HFCs suggested a broader openness in tackling climate change, senior Obama administration officials said Wednesday. They spoke to reporters traveling with Obama to Myanmar from China, where Obama and Xi announced the landmark plan to reduce their carbon emissions. Obama broached the idea of pursuing the joint plan in letter to Xi nine months ago, officials said, sparking secret discussions between U.S. and Chinese officials. Obama pressed the issue again during a meeting with China's vice premier on the sidelines of a U.N. climate summit in September, and the two countries finally sealed the deal in time to announce it in grand fashion at the Great Hall of the People as Obama's trip to China was coming to an end. But Obama's opponents in Congress balked, dismissing the new U.S. target as "job-destroying red tape" that would squeeze the middle class. "The president appears to be undeterred by the American people's clear repudiation of his policies of more regulations and higher energy costs," said House Majority Leader Kevin McCarthy of California. Sen. Mitch McConnell of Kentucky, leader of the Republicans who will take control of the Senate in January, said the deal "requires the Chinese to do nothing at all for 16 years while these carbon emissions regulations are wreaking havoc in my state and other states." Under the agreement, Obama set a goal to cut U.S. emissions between 26 and 28 percent by 2025, compared with 2005 levels. Officials have said the U.S. is already on track to meet Obama's earlier goal to lower emissions 17 percent by 2020, and that the revised goal meant the U.S. would be cutting pollution roughly twice as fast during a five-year period starting in 2020. China, whose emissions are growing as it builds new coal plants, set a target for its emissions to peak by about 2030 - earlier if possible - with the idea being that its emissions would then start falling. Although that goal still allows China to keep pumping more carbon dioxide for the next 16 years, it marked an unprecedented step for Beijing, which has been reluctant to be boxed in on climate by the global community. "This is, in my view, the most important bilateral climate announcement ever," said David Sandalow, a former top environmental official at the White House and the Energy Department. World leaders who have been pressing for a global climate treaty heralded the deal, with U.N. Secretary-General Ban Ki-moon urging all other nations to follow Obama's and Xi's lead by announcing their own emissions targets by early next year. Former Vice President Al Gore, a prominent environmentalist, called the Chinese move "a signal of groundbreaking progress from the world's largest polluter." Scientists have pointed to the budding climate treaty, intended to be finalized next year in Paris, as a final opportunity to get emissions in check before the worst effects of climate change become unavoidable. Each nation is supposed to pledge to cut emissions by a specific amount, although negotiators are still haggling over whether those contributions should be binding. Last month, the European Union said it would cut its emissions 40 percent by 2030, compared to 1990 levels. Taken together, the U.S, China and the EU account for more than half of global emissions, and there were already indications that the world's next-biggest emitter - India - might be feeling the pressure. "The international community will now expect India to make some firm commitments," said Jairam Ramesh, the former head of India's Environment Ministry. Developing nations like India and China have long balked at being on the hook for climate change as much as wealthy nations like the U.S. that have been polluting for much longer. But China analysts said Beijing's willingness to cap its future emissions and to put Xi front and center signaled a significant turnaround. For Obama, the fight against climate change has become a central facet of the legacy he hopes to leave. Facing opposition in Congress, Obama has sought to bypass lawmakers through emissions regulations on power plants and vehicles. His aides say his audacity on those fronts has boosted his credibility on climate change overseas. In China, the smog-laden skies over its cities have become a source of embarrassment that the government has sought to obscure. Ahead of the economic summit that brought Obama and other leaders to Beijing, authorities shut down factories, banned wood fires and kept half the cars off the road. Associated Press writers Nedra Pickler, Charles Babington and Dina Cappiello in Washington, Jack Cheng, Christopher Bodeen and Julie Pace in Beijing and Katy Daigle in New Delhi contributed to this report.