China and the US have ratified the Paris Agreement on climate change, giving a boost to efforts to bring the accord into effect by the end of this year.
China's National People's Congress legislature voted to adopt "the proposal to review and ratify the Paris Agreement".
That was followed by the United States shortly after President Barack Obama arrived at the G20 summit, which starts on Sunday in China.
He said the agreement may be remembered as "the moment we finally decided to save our planet", while his counterpart Xi Jinping said the milestone marked the start of a "global government system" for climate change.
"This is not a fight that any one country no matter how powerful can take alone," Mr Obama said of the pact.
"Some day we may see this as the moment that we finally decided to save our planet."
UN Secretary General Ban Ki-moon - who said he was 'honoured' to have received documents from the two nations formally entering them into the pact - said he will hold a event in New York to which he will invite other world leaders to formally ratify the agreement.
It needs the participation of 55 countries, representing 55% of the world's emissions.
"We just need another 29 countries representing 16 per cent of global emissions to bring this Paris Agreement into force," Mr Ban said. "I am hopeful and optimistic that we can do it before the end of this year and before my term as Secretary-General of the United Nations ends.
"I urge all leaders, particularly G20 countries, to accelerate their domestic ratification processes so we can turn the aspirations of Paris into the transformative climate action the world so urgently needs."
The Paris pact calls for capping global warming at well below 2C (3.6F), and 1.5C (2.7F) if possible, compared with pre-industrial levels.
China is responsible for about 25% of global carbon emissions, with the US in second place on about 15%, making their efforts crucial in the fight against warming.
While tensions have risen between Beijing and Washington during President Obama's term over issues including cyber-hacking, the South China Sea and the planned deployment of a US anti-missile system in South Korea, combating climate change is one area where both countries have stressed they can work together.
To build momentum for a deal, they set a 2030 deadline for emissions to stop rising and announced their "shared conviction that climate change is one of the greatest threats facing humanity".
China had said in April that it would ratify the Paris Agreement, negotiated by representatives of 195 nations in the French capital last year, before its hosting of the G20.
Li Shuo, senior climate policy adviser for Greenpeace, said that the two countries acting on the agreement was "a very important next step".
If the agreement is eventually adopted, he said: "We'll have a truly global climate agreement that will bind the two biggest emitters in the world."
He added: "Xi and Obama should seize the opportunity to lead the world's 20 wealthiest nations by joining and building on the Paris Agreement."