The US and China said to be responsible for 40% of the world’s carbon emissions have announced ratification of the Paris global climate agreement.
After arriving with other leaders of G20 nations for a summit in the city of Hangzhou, Mr Obama said: “History will judge today’s effort as pivotal.”
CO2 emissions are the driving force behind climate change.
Last December, countries agreed to cut emissions enough to keep the global average rise in temperatures below 2C.
The Paris deal is the world’s first comprehensive climate agreement. It will only come into force legally after it is ratified by at least 55 countries, which between them produce 55% of global carbon emissions.
Members of China’s National People’s Congress Standing Committee adopted “the proposal to review and ratify the Paris Agreement” at the end of a week-long session.
The White House issued a statement on Saturday morning announcing the US ratification.
In a speech in Hangzhou, Mr Obama said the Paris deal was the “single best chance that has to deal with a problem that could end up transforming this planet”.
He praised US and Chinese leadership on the climate issue, saying: “We are moving the world significantly towards the goal we have set.”
UN Secretary General Ban Ki-moon praised Mr Obama for what he called “inspiring” leadership.
Mr Ban said Mr Obama and China’s President Xi Jinping had both been “far-sighted, bold and ambitious”.
Analysts, however, warn that the target of keeping temperature rises below 2C is already in danger of being breached.
For 14 consecutive months meteorologists have recorded the hottest month on record, and the UK’s Met Office has forecast that 2016 is likely to hit temperatures 1.1C above pre-industrial levels.
Average temperatures worldwide are likely to increase more in the coming years as the effect of previous carbon emissions makes itself felt.
The G20 summit in Hangzhou starts on Sunday.