The deal, worth £600m over a possible four years, was awarded to the firm through the Procurement Scotland tendering process.

Starting in October it will cover schools, universities, hospitals and prisons together with all large government and local authority buildings.

Willie MacDiarmid, ScottishPower’s director of energy retail, said: “The opportunity to supply green energy to our country’s large public buildings, from the Scottish Parliament and Edinburgh Castle to all schools and hospitals, is a major achievement.

“Scotland has the best renewable energy resources in Europe and as we increase the capacity of our green generation it is only right that the Scottish Government should lead the way in supporting a greener future.”

Procurement Scotland’s tendering process started in September last year with six major energy companies taking part in the process.

As part of the contract ScottishPower also won the right to power all of Scotland’s street lighting requirements.

Luke Walsh

Action inspires action. Stay ahead of the curve with sustainability and energy newsletters from edie