"We are under no illusions about the level, breadth and depth of action that is required.

"That is why we need to build a broad parliamentary and national consensus in moving forward to realise our ambitions and capitalise on our opportunities."

The planned legislation would require progress towards the targets to be reported to parliament, although the government has ruled out penalty fines for those who failed to meet them.

Mr Swinney also said the bill had the potential to help Scotland become the green energy capital of Europe, but said it had to be a long-term effort.

Wing mirrors

He added: "We acknowledge that, in itself, reducing Scotland's emissions by 80% will make no difference to the global environment unless similar reductions are realised in global emissions.

"But by taking a lead, Scotland can demonstrate to others what can be achieved."

Mr Swinney said he was also considering a separate move to tackle Scotland's current "inadequate" flood alleviation legislation.

Labour environment spokesman Rhona Brankin said there was a general consensus on the need for legislation to tackle climate change.

But she pressed Mr Swinney on whether he had ditched the SNP election manifesto pledge of "mandatory" 3% annual carbon reduction targets, which were not specifically mentioned in his statement to parliament.

John Swinney said Scotland could be a green energy capital

"Any more u-turns and SNP ministers are going to have to be fitted with wing mirrors," she said.

"Once again, SNP manifesto commitments have crumbled in the face of scrutiny."

Tory climate change spokesman Alex Johnstone voiced concerns about targets which would be contained in the bill.

"While I fully accept that Scotland operates from different baselines and has different levels of potential to receive results in this area, it is essential that Scotland's businesses and local authorities are not placed under a disproportionate burden," he said.

Liberal Democrat Finance spokesman Tavish Scott called on Mr Swinney to ensure that aviation was included in the European carbon trading emissions scheme, adding: "That must be a central component of the future work in this area."

Green MSP Patrick Harvie claimed the announcement would spark some disappointment over the lack of a commitment to annual targets.

He asked of Mr Swinney: "Will he commit to make sure that his government reports this year, next year and every year even before the legislation, so that we can see the progress being made by virtue of the policies he pursues today and tomorrow in terms of carbon emissions?"