Housing Minister Kevin Stewart said: "We know that people living in these unsuitable environments can for too long often lack cooking or washing facilities, and some have reported that they cannot have visits from family or friends.

"These experiences have a detrimental effect on people's physical and mental wellbeing, preventing them from rebuilding their lives.

"While temporary accommodation can offer an important emergency safety net for anyone who finds themselves homeless, such as those fleeing domestic violence, it should be a purely temporary measure."

Image copyrightGetty ImagesImage caption
A total of 29,894 people were assessed as homeless or threatened with homelessness in 2018-19, a 2% rise on the previous year and the third year in a row the tally has gone up

Mr Stewart said the Scottish government was investing £32.5m in supporting local authorities to "prioritise settled accommodation for all".

Latest Scottish government figures show that 36,465 people asked for help to find a home from their local council in 2018-19, up 3% on the previous year.

It is the second year applications have risen after a period of consistent decline since 2005-06.

The figures showed also showed increasing numbers of people were also staying in temporary accommodation, such as B&Bs.

'Dehumanising stays'

There were a total of 620 breaches of the rules on suitable accommodation offered to vulnerable people or families, an increase of 225 compared with the previous year.

A total of 465 of these were in Edinburgh.

Jon Sparkes, chief executive of homeless charity Crisis, said: "We strongly welcome the announcement that the Scottish government will change the law so that people will no longer have to live in the most unsuitable forms of temporary accommodation for longer than seven days.

"This marks a major achievement for our Life in Limbo campaign, a three-year project which has sought to put an end to lengthy and dehumanising stays in unsupported hostels, hotels and B&Bs.

"This decision is a recognition of the resolve of our clients to shine a light on the inhumane conditions they were experiencing and the determination to ensure no-one else was subjected to these prolonged stays."