MSPs have passed new laws to end the right to buy for new council and social housing tenants.
The SNP government said the policy, introduced by Margaret Thatcher, had had its day, and action was needed to tackle shortages in rented housing.
The move formed part of the Housing Bill, which also sets out measures for taking action against rogue landlords.
The legislation also aims to beef up protection for tenants through a new independent housing regulator.
The Tories failed in a last-minute bid to remove the right to buy reforms from the bill during its final vote at Holyrood, while Labour challenged ministers to provide enough cash to build more homes, rather than "tinkering" with the policy.
The Scottish government has said 500,000 homes were sold in Scotland since the introduction of right to buy in the early 80s - but in recent years councils have been forced to suspend the policy as their stock of social housing to rent has dwindled.
Ministers said stopping all new tenants from buying their homes could see up to 18,000 properties retained over 10 years.
At the same time, the government said its three-year, £1.5bn investment scheme would deliver about 2,000 new affordable homes.
Housing Minister Alex Neil said the government had been "balanced and moderate" in its approach to the changes.
He told parliament: "In the year when the right-to-buy was introduced by Mrs Thatcher, in that year, 1980, there were over 5,000 new council houses built in Scotland.
"They declined year upon year upon year right up until 1997, the last year of Conservative government, and there were 177 new houses built in Scotland by councils that year.
"If that is not living proof that the right-to-buy destroyed the council house building programme in Scotland, I don't know what is."
But Tory MSP David McLetchie said right to buy enabled 450,000 households to own their own home.
"It seems the government wishes to do away with this important source of revenue at precisely the time when affordable housing budgets are likely to be squeezed significantly," he argued, adding: "This is sheer madness."
Labour housing spokeswoman Mary Mulligan accused the government of "completely missing the point" on the reforms.
"The SNP need to understand that the best way to deal with homelessness is to provide more support to tenants, strengthen communities and build more homes," she said.
Liberal Democrat Jim Tolson accused Mr McLetchie of trying to "justify the unjustifiable" with his defence of the right-to-buy.
"The social rented sector has moved on quite significantly since the 80s," he said.
"We need to modernise right-to-buy and bring it fully up-to-date."
The Scottish Housing Regulator, which the bill also establishes, aims to protect social housing tenants, including those at risk of being made homeless.
The body will keep a register of social landlords and has powers to intervene in cases of failing landlords with the ability to set improvement targets or, in serious cases, issue enforcement notices to force them to take action.
Impeding the work of the regulator is punishable with a fine of up to £5,000, according to the bill.
The legislation also sets out a Scottish social housing charter, which sets out minimum standards to which landlords must comply.