In his first term, President Obama put his political muscle behind passing health-care reform and financial regulations instead of a global warming bill, missing the best opportunity ever to establish a comprehensive national climate program. Then he hardly mentioned global warming.

But despite these lousy beginnings, Obama’s accumulating accomplishments on climate change might define his legacy.

Wednesday saw a major breakthrough. In Beijing, Obama and Chinese President Xi Jinping struck a serious, medium-term, joint greenhouse emissions deal, a landmark agreement of the sort that critics argued would never happen. The pact does not merely commit the countries to trajectories they are already taking. It will require both nations to push harder toward cleaner energy.

President Obama, left, and Chinese President Xi Jinping drink a toast at a lunch banquet in the Great Hall of the People in Beijing Wednesday.(AP Photo/Greg Baker, Pool) President Obama and Chinese President Xi Jinping toast at a lunch banquet in the Great Hall of the People in Beijing on Wednesday. (AP Photo/Greg Baker, Pool)

This sweeps away years of anxiety about whether China and the United States — responsible together for nearly half of global greenhouse gas output — would ever cooperate on climate, rather than each perpetually waiting for the other to act. It will always be tough to get many nations to move together, and keep moving together, in the same direction. But two dominant — and historically reluctant — players now are.

Obama could pull this off because of several things his administration has done since his initial failure on climate legislation. The decades-old Clean Air Act gives the executive branch various powers to restrict air pollution — including, the Supreme Court confirmed, carbon dioxide. Obama’s Environmental Protection Agency has used these powers. The EPA struck a bargain with automakers to drastically increase the fuel efficiency of cars and trucks sold in the United States. Then it set greenhouse emissions standards on new and significantly rebuilt power plants, and after that on existing power plants, the most significant anti-carbon measure in the country’s history. Add in a variety of smaller initiatives that affect the country’s carbon footprint, and the result is Obama’s increasingly ambitious Climate Action Plan.

Meanwhile, the Affordable Care Act, Obama’s other major policy accomplishment, is once again in serious legal peril. The Supreme Court last week announced it would hear a challenge to a crucial piece of the policy’s design — the subsidies that enable low- and middle-income Americans to buy coverage. The argument against the law is shaky. But the justices might nevertheless unravel the policy, just as it was beginning to succeed.

A future Republican president, of course, might also try to do the same with Obama’s carbon dioxide initiatives, and courts will have to pass judgment on how the EPA implements its anti-carbon programs. Obama’s legacy could end up being one of tragic policy frustration. But there’s still a good chance he will be remembered best as the president who finally started the country down a responsible path on greenhouse emissions.