Housing association and council new builds have increased
The number of affordable homes built by the public sector in Scotland is at its highest level since 1995, according to government figures.
Statistics showed 21,384 new houses were built over the last year.
While new builds in the private sector have fallen, new builds by housing associations and councils accounted for nearly a quarter of new homes.
The Scottish Government said a total of 4,913 new affordable homes were completed last year.
A further £644m has been allocated for affordable housing this year, with a commitment to invest more than £1.5bn over three years.
Approvals have been made to allow work to start on 1,343 council houses this financial year, supported by £50m of central government funding.
Deputy First Minister Nicola Sturgeon said: "Building projects throughout the country are bringing much-needed new contracts and safeguarding jobs for Scotland's construction industry.
"Against a backdrop of continuing economic uncertainty, and at a time when new builds in the private sector are declining, this is more important than ever.
The Chartered Institute of Housing Scotland welcomed the increase - but warned the boost could fall away without more investment next year.
The organisation's director, Alan Ferguson, said: "More affordable homes have been built this year because the Scottish Government brought forward £120m of funding from the planned 2010-11 spend.
"However, what the sector and the Scottish Government knew is that this would leave a gaping hole in the budget for affordable housing in 2010-11.
"To date we have not seen any plans from the Scottish Government as to how they intend to fill this hole in the forthcoming Scottish Budget."
Graeme Brown, director of housing charity Shelter Scotland, welcomed the increase, but warned: "When you include the 3,700 homes sold through right to buy, this year's record 4,913 affordable homes across all tenures is really only a net increase of 1,213.
"We're only treading water at a time when we need to be seriously increasing the number of new homes we are building in Scotland."