The social projected said it was “absolutely thrilled” to have reached such a figure.

More than 8,000 people descended on Edinburgh’s Princes Street gardens to take part in the “world’s biggest sleepout” even in the icy temperatures.

Spirits were roused as they were joined by celebrities and witnessed performances from Liam Gallagher, Deacon Blue, Amy Macdonald and Frightened Rabbit, as well as John Cleese reading a bedtime story.

The project, organised by Josh Littlejohn, co-founder of Social Bite was to raise money to tackle homelessness.

Social Bite wrote on its Facebook page: “Thank you so much to every single person that slept out or donated a Christmas dinner and raised so much money for Scotland’s homeless people. You have simultaneously registered your disgust at the system that results in people becoming homeless in such large numbers, as well as your love and affection for people with no place to call a home of their own.

“The job over the next 12 months is to use this money to get a minimum of 500 people off the streets and temporary shelters into a proper home with a funded support resource - and in doing so help to restructure our response to homelessness for the long term. We look forward to working with lots of homelessness charities, housing associations and the Scottish Government to this end.

“Today (Sunday) our shops opened up to feed and give presents to homeless people throughout Edinburgh, Glasgow and Aberdeen.