Theresa May has drawn angry criticism for saying it took the sight of melting glaciers while on holiday to realise the importance of reducing greenhouse emissions, despite being regularly advised about the need to take drastic action by “the best climate scientists in the world”.

Ms May told reporters it was watching the ice melt in Switzerland over 10 years’ worth of walking holidays with her husband Philip that “brought home” the reality of global warming.

Legislation enshrining the 2050 target for the UK to produce no more carbon dioxide than it removes from the atmosphere came into law as Ms May flew to the annual meeting of G20 nations in Japan.

It was introduced by Ms May earlier this month, but only after she had announced the end of her nearly three-year term as prime minister as she looks to secure a legacy following her failure to deliver Brexit.

Critics were quick to point out that if she saw it as a real priority she could have taken action at the beginning of her term in 2016.

"Act now or swim later" - Children worldwide protest climate change Show all 38 1 /38 "Act now or swim later" - Children worldwide protest climate change "Act now or swim later" - Children worldwide protest climate change School children protest in London on March 15 Reuters "Act now or swim later" - Children worldwide protest climate change School children protest in Magdeburg, Germany on March 15 AP "Act now or swim later" - Children worldwide protest climate change School children protest outside Holyrood in Edinburgh on March 15 Getty "Act now or swim later" - Children worldwide protest climate change School children protest in Cape Town, South Africa on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in New York on March 15 AFP/Getty Images "Act now or swim later" - Children worldwide protest climate change School children protest in Madrid on March 15 AP "Act now or swim later" - Children worldwide protest climate change School children protest in Quezon City, Philippines on March 15 Getty Images "Act now or swim later" - Children worldwide protest climate change School children protest in Vienna on March 15 AFP/Getty Images "Act now or swim later" - Children worldwide protest climate change School children protest in Dublin on March 15 PA "Act now or swim later" - Children worldwide protest climate change School children protest in Canterbury, Kent on march 15 PA "Act now or swim later" - Children worldwide protest climate change School children protest outside Holyrood in Edinburgh on March 15 Getty "Act now or swim later" - Children worldwide protest climate change School children protest in Erfurt, Germany on March 15 AP "Act now or swim later" - Children worldwide protest climate change School children protest in Zagreb, Croatia on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in Lisbon on March 15 Reuters "Act now or swim later" - Children worldwide protest climate change School children protest in Edinburgh on March 15 Getty "Act now or swim later" - Children worldwide protest climate change School children protest in Florence, Italy on March 15 Sign reads: there is no future without a planet, let's not sell it for money EPA "Act now or swim later" - Children worldwide protest climate change School children protest in Vienna on March 15 Getty "Act now or swim later" - Children worldwide protest climate change School children protest in Brighton on March 15 Reuters "Act now or swim later" - Children worldwide protest climate change School children protest outside Holyrood in Edinburgh Getty "Act now or swim later" - Children worldwide protest climate change School children protest in Cambridge on March 15 PA "Act now or swim later" - Children worldwide protest climate change Students protest in Bangalore, India on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in Lausanne, Switzerland on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in Cape Town, South Africa on March 15 AP "Act now or swim later" - Children worldwide protest climate change Students protest in Bangalore, India on March 15 EPA "Act now or swim later" - Children worldwide protest climate change A student protests in Lucerne, Switzerland on 15 March EPA "Act now or swim later" - Children worldwide protest climate change School children protest in London on March 15 AFP/Getty Images "Act now or swim later" - Children worldwide protest climate change School children protest in Lausanne, Switzerland on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in Milan, Italy on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in London on March 15 AFP/Getty "Act now or swim later" - Children worldwide protest climate change School children protest in Lund, Sweden on March 15 AP "Act now or swim later" - Children worldwide protest climate change School children protest in London on March 15 PA "Act now or swim later" - Children worldwide protest climate change A poster with Greta Thunberg, who began the current children's movement at the protest in Lausanne, Switzerland on March 15 AP "Act now or swim later" - Children worldwide protest climate change School children protest in Cape Town, South Africa on March 15 EPA "Act now or swim later" - Children worldwide protest climate change School children protest in London on March 15 PA "Act now or swim later" - Children worldwide protest climate change School children protest in Canterbury, Kent on March 15 PA "Act now or swim later" - Children worldwide protest climate change School children protest in London on March 15 PA "Act now or swim later" - Children worldwide protest climate change School children protest in Canterbury, Kent on March 15 PA "Act now or swim later" - Children worldwide protest climate change School children protest outside Holyrood in Edinburgh Getty

The new law is an update on a 2008 pledge to reduce emissions by 80 per cent by 2050, which was based on previous advice from the Committee on Climate Change.

Despite the legislation, the UK has been slow to decarbonise. It is currently on course to miss existing 2025 and 2030 pledges.

Professor Mark Maslin, from University College London, said Ms May had been deaf to warnings from climate experts telling her for years emissions needed to be dramatically reduced.

He told The Independent: “May has access to the best climate scientists in the world. Throughout her premiership the UK has had a law mandating that we cut our emissions by 80 per cent by 2050 and a committee that continually tells her how we can achieve this.

“But given all this she has only just realised that climate change is a threat – basically too little too late.

“May and her government has been completely uninterested in climate change.”

Mike Childs, head of science at Friends of the Earth, criticised her for not acting sooner on her observations. He told The Independent: “If a day is a long time in politics, a decade is a very long time for the PM to be aware of devastating climate change that she admits to seeing with her own eyes.

Eastern European states block bid for EU climate change 2050 decarbonisation target

“We know about the dangers of hitting 1.5C of global warming so it’s incumbent on any leader to do everything possible, as quickly as possible, to get ahead of this massive risk. There’s no such thing as going too fast in mitigating climate chaos.”

Ms May said she would use her final global summit as prime minister to urge other major economies at the Osaka gathering to follow the UK’s lead in tackling the climate emergency.

Prof Maslin said: “Her new-found insights are because the world is changing – Extinction Rebellion, the climate strikes, Greta Thunberg and even the BBC and Netflix are altering public opinion that even old politicians finally feel they must be seen to be on the right side of history.”

Explaining how global warming became a personal issue for her, Ms May said: “When Philip and I go walking in Switzerland, there’s a particular place we go to where over the last decade you will have seen the glacier retreating quickly, and this has brought home to me the importance of the issue of climate change.

“The G20 represents 80 per cent of emissions, so it’s not just about what the UK does, it’s about what we can do together,” she added.

“I’m going to be taking a message to the other leaders of the importance of them acting, following the UK’s lead and acting on this issue.”

Speaking on board her official plane, May added: “I’m going to be talking about the importance of us continuing to work together cooperatively and us working with international partners.

“I’m very pleased to say that when we get off the plane, our net-zero target for 2050 will have entered law in the UK and that’s an important contribution to make sure that we are not contributing to climate change in the future.”

Morten Thaysen, a climate campaigner at Greenpeace UK said: “It’s easy to make comparisons between the amount of time it took the prime minister to recognise climate change as a threat and the notoriously slow pace of the glaciers that inspired her.