The Scottish government's targets for cutting greenhouse gas emissions have been strengthened, as MSPs voted to put down a "net-zero" target in law.
The Climate Change Bill - which aims to have all emissions offset by 2045 - was passed by 113 votes to 0 at Holyrood.
Ministers agreed to a Labour amendment to up the interim target, with members agreeing to target a 75% reduction by 2030, compared with 1990 levels.
However, a Green bid to increase this goal to 80% was heavily defeated.
Environment Secretary Roseanna Cunningham said the government was "putting in place the most stringent framework of statutory targets of any country in the world".
The Greens abstained in the final vote, and said members should "not pretend this bill is anywhere near meaningful action to address the climate emergency".
The bill sets a legally-binding "net-zero" target of 2045, meaning any remaining emissions would have to be entirely offset with measures such as increased tree planting and carbon capture and storage technology.
The target for Scotland is five years ahead of the date set for the whole of the UK.
'Every policy lever'
However, there was debate at Holyrood over the speed of change, with some parties calling for tougher interim targets.
The bill as drafted had said emissions should be 70% lower than 1990 levels by the end of the next decade. Labour and the Lib Dems had pushed for that to be increased to 75%, while the Greens called for the target to be 80%.
The Scottish government accepted the proposed 75% target, and Ms Cunningham said ministers would seek further advice from the Committee on Climate Change on updating plans further within six months.
A pledge to hold a "citizens' assembly" on how to tackle climate change was also added to the bill.
She said: "No one should be in any doubt of the Scottish government's commitment to use every policy lever at our disposal to rise to this challenge.
"Our end target is firmly based on what we are told is the limit of what can currently be achieved.
"It is the maximum possible ambition based upon the best available science and requires the UK to take action to meet their targets if Scotland is to meet ours.
"In the interim, while there is some uncertainty over the precise route that can be taken, we believe it is right to be as ambitious as possible to drive the action required to make the changes we need."
The 75% target was unanimously accepted by opposition members, although the Scottish Greens said it was a "weak compromise".
Green MSP Mark Ruskell put forward a proposal for an 80% reduction by 2030, but saw only seven members back it, while 92 voted against.
After his party abstained in the final vote, he said: "Let's not pretend this bill is anywhere near meaningful action to address the climate emergency.
"The other parties cannot hide behind targets. Targets are meaningless without action to meet them."
The bill was welcomed by some campaign groups, although others called for more urgent action.
Tom Ballantine of Stop Climate Chaos Scotland said the bill set a "strong long-term target", and said "campaigners should rightly feel proud" of having forced a "last minute increase in ambition".
Richard Dixon, director of Friends of the Earth Scotland, added: "We wanted more, but now we really do have a climate bill that can make a difference."
Extinction Rebellion Scotland said the legislation did not look like an "emergency response", saying: "The politicians have failed us. They do not have the ability or foresight to make the radical changes necessary to limit global warming."
First Minister Nicola Sturgeon declared a climate emergency at the SNP's spring conference in Edinburgh in April.
In recent months, protests calling for tougher action have been held across Scotland, culminating in a global youth strike on Friday that involved tens of thousands of protestors.
This week, at a UN climate summit in New York, the young activist Greta Thunberg accused world leaders of failing to act on climate change.
The annual UN conference on climate change, being held this year in Chile, will come to Glasgow in 2020.