The move is based on a report from independent advisory group the Committee on Climate Change (CCC), which was commissioned to advise on the UK’s likely transition to a net zero carbon economy.
The legislation to do so is an amendment to the Climate Change Act 2008.
In its report, the CCC forecast significant benefits to public health and savings to the NHS from better air quality and less noise pollution, as well as improved biodiversity.
The UK will conduct a further assessment within five years to confirm if other major economies are following its lead, and to ensure UK industries are not facing unfair competition.
Prime minister Teresa May said: “Now is the time to go further and faster to safeguard the environment for our children. 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.
“Standing by is not an option. Reaching net zero by 2050 is an ambitious target, but it is crucial that we achieve it to ensure we protect our planet for future generations.
Business secretary Greg Clark said: “Almost 400,000 people are already employed in the low-carbon sector and its supply chains across the country... The UK is already a centre for clean growth and innovation. Low carbon technology and clean energy contribute £44.5 billion to our economy every year.
“We are ending the sale of new diesel and petrol cars and vans through our world-leading Road to Zero Strategy, and protecting biodiversity and promoting sustainability through our 25 Year Environment Plan.”
CBI director-general Carolyn Fairbairn said UK business “stands squarely” behind this commitment, adding: “This legislation must be followed by a commitment to long-term policies that support decarbonisation across the economy.
“Some sectors will need clear pathways to enable investment in low-carbon technologies, and it is vital that there is cross-government coordination on the policies and regulation needed to deliver a clean future.”