A Tory MSP won a commitment to limit the length of time homeless people can spend in unsuitable temporary accommodation.
Conservative housing spokesman Graham Simpson won all-party backing for a legal limit of seven days to be introduced.
Housing minister Kevin Stewart accepted an amendment from Mr Simpson during a debate in the Scottish parliament on homelessness. The government will consult on the issue early next year and introduce legislation in the next programme for government.
Mr Simpson said: "It was fantastic that the government agreed to this and it will make a real difference to some of the most-vulnerable in society."
“We have come a long way in the debate on homelessness in this parliamentary term. I took part in the year-long inquiry by the Local Government and Communities committee, which preceded - and I would say led to - the government setting up the Homeless and Rough Sleeping Action Group.
“I welcome the SNP government listening to my calls to change the law on temporary accommodation. This will see homeless people moved to more settled housing after one week in temporary shelter.
“Throughout my time on the Local Government and Communities Committee, I have met with many people who have experienced, or are experiencing, homelessness. I have always come away with admiration at the courage and resilience of my fellow Scots – in the face of horrendous weather conditions and the feeling of exclusion from the rest of society. We discussed the impact that this had on their lives and how we – as a society - can try to eradicate this social evil.
“Housing is a human right. But the huge lack of housing in Scotland has led to people sleeping out on the streets, stuck in poor quality accommodation or in a cramped hostel room. We must re-double our efforts to address this public scandal. How we help those most in need is a measure of society’s values.”