Image caption The right to buy council homes was introduced in 1980

The right of council tenants to buy the homes they rent at discounted rates will be abolished in Scotland.

Deputy First Minister Nicola Sturgeon confirmed the government's decision to end the scheme on a visit to a housing association in Glasgow.

Margaret Thatcher's Tory government introduced the scheme in 1980.

The Scottish government has already scrapped "right to buy" for new tenants and it will be abolished altogether in 2017.

We can no longer afford to see badly needed homes lost to the social sector Nicola Sturgeon, Deputy First Minister

Since the opportunity to buy was introduced, 455,000 Scottish properties have been sold.

The Scottish government said that had reduced the number of homes available for cheap rent and increased the waiting lists for properties of this type.

Ms Sturgeon, during a visit to Queens Cross Housing Association, said the move would "safeguard social housing stock for future generations".

She added: "It is absolutely vital that people can access social housing when they need it most. Social housing is under significant pressure and so too are the budgets that support it.

"The Scottish government is doing everything possible to maximise our investment in housing and deliver on our target of 30,000 new, affordable homes over the lifetime of this parliament.

"But, given the pressure on both the housing stock and budgets - and with 400,000 people on waiting lists for social housing - we can no longer afford to see badly needed homes lost to the social sector."

Analysis "Two thirds of residential properties in Scotland are now owned by their occupiers. But there is a big shortage of homes for rent, particularly social housing. It is mainly for that reason that the Scottish government has restricted the 'right to buy'. In March 2011, it was scrapped for new tenants and new social housing. From 2017, it will be abolished altogether. This is in marked contrast to policy in England. In this year's budget, the UK government increased the discount available to tenants in London. The Chancellor also promised to reduce the qualifying period from five to three years to widen access. Devolution continues to increase the policy differences between Scotland and other parts of the UK."

In November last year, a Scottish government consultation revealed that a majority of Scottish councils wanted the right to buy policy scrapped.

The report also showed that many tenants and social landlords wanted it to end.

An opponent of the move is former Scottish Conservative Party leader Annabel Goldie.

She told BBC Radio Scotland's Good Morning Scotland programme that the policy was "arguably" one of the most "socially liberating" policies to be introduced in Scotland and across the UK.

Miss Goldie added: "I can still remember the days when people lived in monolithic council house schemes - that is what they were called - and they were afflicted by a postcode prejudice.

"They were apprehensive about disclosing their address because they felt it would negate their chance of getting a job or even being accepted for an interview.

"By offering a tenant the right to buy, you did two things - you first of all introduced a freedom to the individual to make a choice about how they wanted to live, and secondly you stopped them being trapped in that environment - because that is exactly what they were."

She went on: "Right to buy freed people from the environmental prison they were in."

Media playback is unsupported on your device Media caption Annabel Goldie: "Right to buy freed people from the environmental prison they were in."

The Scottish Federation of Housing Associations welcomed the Scottish government's announcement.

Its membership manager said: "Right to buy has had its day and has no place in 21st century Scotland.

"It has been beneficial to a relatively small number of individuals, but clearly a loss to the greater public good. Half a million social rented homes have been lost in the 30 years of this policy in Scotland, very often the better stock in the more popular areas."

Although the right to buy policy will come to an end in Scotland in 2017, it continues to exist elsewhere in the UK.