Sales of peat to amateur gardeners will be banned in England from 2024, the government has confirmed.
The move follows a consultation and is part of a pledge to restore peat lands.
These wild, boggy places are sometimes referred to as the UK's rainforests, because of their ability to soak up vast quantities of carbon.
When peat dries out it emits rather than stores greenhouse gases, contributing to climate change.
The ban applies to peat in products designed for everyday gardeners, which accounts for 70% of the peat sold in the UK.
The professional horticulture industry will be exempt for now, but the government says it will work with growers ahead of a planned ban there too.
The ban applies to England, although Environment Minister Lord Benyon said he was working with devolved governments on the issue.
Peatlands are one of the most important areas of the natural world, locking up vast quantities of carbon, he explained.
"If you dig it up out of the ground this very valuable carbon store is broken down and all that carbon is emitted into the atmosphere as carbon dioxide," he told BBC News.
"This ban comes after an enormous amount of work by the industry and by government to find alternatives, but we do not think there is any alternative to a ban on peat and therefore we have taken this decision. "
In the UK alone, peat bogs, moors and fens store about 3.2 billion tonnes of carbon - more than in woodlands and forests - but most are in a poor state after decades of being drained for farming or mined for peat.
In 2021, the government launched a public consultation on the use of peat in horticulture, pledging to ban sales in the amateur sector by the end of 2024, and to set aside Â£50 million to restore peatlands.
More than 5,000 responses were received, the vast majority in favour of the proposals. The government has now confirmed the ban will come into effect by the end of 2024. And it is setting aside Â£5 million from the Â£600 million Nature for Climate Fund to support farmers to grow crops on re-wetted land.
Environmental groups have long campaigned for tougher action, including a ban on peat extraction in the UK.
"It is right that the government is taking action - we absolutely need to protect these really vital sources of carbon," said Georgia Stokes, CEO of Somerset Wildlife Trust.
"However, it's not enough and it's not quick enough; the ban on retail sales of peat is not going to end peat extraction."
Much of the peat used in the UK is imported, however peat continues to be mined, although volumes have been declining in recent years.
Much of the UK peat industry is in Somerset, providing jobs and income to local people.
Somerset County Council confirmed that peat extraction was still taking place in the county at a "limited number of sites", centred around the Glastonbury area.
"We don't have figures for extraction rates or amounts removed in recent years, but the number of operational sites is reducing," a spokesperson told BBC News.
"Our current planning policy mirrors the National Planning Policy Framework in that it would be unlikely new planning permissions for peat extraction would be granted.
"All licenses are due to expire by the end of 2042, however it is anticipated most, if not all, will be complete in advance of this."
Some old peat mines in Somerset have been turned over to conservation, the drainage channels cut for mining peat planted with reed beds.
At Westhay Nature Reserve, sphagnum moss and sundews form a carpet on the boggy ground and the wetlands attract rare birds such as bitterns and curlews.
Down the road, at Honeygar farm, Somerset Wildlife Trust is working to return land that has been drained for farming back into a natural boggy state.
This means re-wetting the peat, achieved by blocking artificial drainage ditches and gullies.
"Once that happens you start to slowly create peat-forming habitat," said Steve Mews of Somerset Wildlife Trust.
Peat forms at an incredibly slow rate, building up over the course of hundreds of years.
In the UK, more than 18 million tonnes of carbon are emitted every year by damaged peat lands.
pursue Helen on Twitter.