LONDON — In one of her final acts as British prime minister, Theresa May pledged Wednesday to pass legislation that will commit the United Kingdom to eliminating its contribution to climate change by 2050, the first country in the Group of Seven advanced economies to do so.
May said that Britain will enact in law a commitment to produce net zero greenhouse gas emissions by 2050, one of the most ambitious targets in the world.
‘‘This country led the world in innovation during the Industrial Revolution, and now we must lead the world to a cleaner, greener form of growth,’’ May said.
Environmental groups welcomed the announcement but raised concerns about how, exactly, Britain plans to meet these targets.
Major protests in the United Kingdom, including by children skipping school to march through cities, have helped push the issue of climate change to the top of the political agenda.
A campaign group called Extinction Rebellion has also organized several high-profile protests, leading to more than 1,000 arrests. One of its demonstrations included a ‘‘die in’’ at the Natural History Museum, where hundreds of demonstrators lay down in a big hall below a skeleton of a blue whale to raise awareness of predicted mass-extinction events caused by humans.
May is keen to cement a legacy beyond Brexit in her final weeks as prime minister. She resigned as party leader Friday and will officially step down as head of government once her successor is found, mostly likely in late July.
‘‘It’s clear this is a legacy issue, and it really is a tremendous legacy for her to leave behind,’’ said Bob Ward, policy director for the London-based Grantham Research Institute on Climate Change and the Environment.
The UK has demonstrated that it knows how to rapidly decarbonize its energy mix. Ward said that since 1990, Britain’s greenhouse gas emissions were reduced by 44 percent while the economy grew by more than 75 percent.
One of the main factors is the phasing out of coal. Last month, Britain went for two weeks without using coal to generate power, the first time it’s done so since the late 19th century.
But achieving the new targets will require profound change — the current policy is to reduce emissions by 80 percent by 2050. Philip Hammond, the finance secretary, said that meeting the change could cost 1 trillion pounds, leaving less money for public services such as schools and hospitals, according to a letter leaked to the Financial Times.
The new law highlights the stark contrast between the UK and the United States administrations over their approaches to climate change. Speaking alongside President Trump at their joint news conference last week, May said that in talks with Trump, she ‘‘set out the UK’s approach to tackling climate change and our continued support for the Paris agreement.’’
Trump has previously called climate change a ‘‘hoax’’ and announced his intention to pull the United States out of the Paris climate accord.
Trump told Britain’s ITV broadcaster last week that he was pressed on the issue by Prince Charles, who has long been outspoken about the environment. Trump said he told Charles that ‘‘the United States right now has among the cleanest climates.’’
Analysts said the legislation could go through within a week or so, since it can be done through an amendment to the 2008 Climate Change Act.
Greenpeace UK said it was a ‘‘big moment’’ in the fight against climate change, but the group also raised concerns about loopholes that could mean Britain would achieve its goal partly through international carbon credits, which Greenpeace argued could shift the burden to developing nations.
Doug Parr, chief scientist for Greenpeace UK, said in a statement: ‘‘As the birthplace of the industrial revolution, it is right that the UK is the world’s first major economy to commit to completely end its contribution to climate change, but trying to shift the burden to developing nations through International Carbon Credits undermines that commitment. This type of offsetting has a history of failure and is not, according the government’s climate advisers, cost efficient.’’
The decision ‘‘fires the starting gun for a fundamental transformation of our economy,’’ Parr said. ‘‘The government must immediately upgrade our electricity, construction, heating, agriculture and transport systems. They must cancel the Heathrow 3rd runway and road-building plans, and invest public money and provide significant policy support to protect communities, workers and the planet.’’
Several of the politicians seeking to replace May as prime minister have come out with strong positions on tackling climate change. Boris Johnson, the current favorite, has written several newspaper articles in support of the environment.
Ward, the climate change expert, said none of the candidates hoping to be the next prime minister are likely to speak out against the target, not least because it’s seen as an important issue for younger voters.
‘‘You won’t see any of the Tory leadership hopefuls speaking out against this,’’ he said. ‘‘That creates a sense of political stability, at least. It’s not about whether we should get to the 2050 target, it will be a discussion about the best way of doing it.’’