Figures from the UK Government's Department of Energy and Climate Change (DECC) showed 40.3% of energy consumption in 2012 was met by green power - up from 36.3% the previous year and 24.1% in 2010.
Scotland's energy minister Fergus Ewing said the figures showed renewables were "going from strength to strength".
He said Scotland was on course for half of electricity use to come from renewable sources by 2015, an interim target ahead of the goal of having the sector generate the equivalent of 100% of the country's electricity needs by 2020.
Scotland continues to produce more energy than it uses, with more than 26% of electricity generated here last year being exported.
Nuclear power provided 34.4% of electricity generated in Scotland in 2012, while 29.8% came from renewables, 24.9% came from coal, 8% from gas and 2.8% from oil and other sources.
Scotland's proportion of power from renewable sources was much higher than the rest of the UK. While 29.8% of electricity generated north of the Border was from renewables, in England the sector only produced 8.2% of electricity, while in Wales and Northern Ireland renewables accounted for 8.7% and 15.9% of electricity generated.
Mr Ewing said: "These figures show that renewable electricity in Scotland is going from strength to strength, confirming that 2012 was a record year for generation in Scotland and that 2013 looks set to be even better.
"Our support for renewable generation, combined with energy efficiency measures, will help protect Scotland's consumers by keeping energy prices down in the long term."
Environmental campaigners at WWF Scotland welcomed the figures, but said to meet the Scottish targets "significant amounts" of offshore wind power would be needed.
Director Lang Banks said: "It's great news that Scotland's renewable energy capacity and output both continue to grow, and this year looks like being another record breaker. Most importantly, Scotland is further along the track to meeting its 2020 target than we thought, which means ever greater amounts of climate change emissions are being avoided every day.
"However, in order to remain on target Scotland will need to deploy significant amounts of offshore wind in the near future. It's therefore vital that the UK Government gives a stronger signal of its ambition on the growth of offshore wind in Scotland's seas, as well as the necessary support needed to deliver that growth."