The Olympic torch will be extinguished early on Monday morning.
But the Games have been memorable for so many Scottish representatives, who achieved an unprecedented amount of success away from their homeland.
And First Minister Nicola Sturgeon has paid tribute to the hard work and dedication of all athletes who competed.
Whether taking part individually or in team events, Scots secured a final tally of four gold medals, seven silver medals and two bronze medals, making this the most successful overseas Olympics ever for Scottish athletes.
Andy Murray, Heather Stanning, Katie Archibald and Callum Skinner all won gold.
In either individual or team events, Katherine Grainger, David Florence, Callum Skinner, Karen Bennett, Polly Swann, Mark Bennett, Mark Robertson, Duncan Scott, Dan Wallace, Stephen Milne and Robbie Renwick won silver.
And, in the judo competition, Sally Conway secured the bronze while Eilidh Doyle led the women’s 400m relay quartet to an historic bronze medal.
The First Minister said: “There is no higher honour than competing on a global stage and all our sportsmen and women have done Scotland proud as part of Team GB.
“This has been a fantastic games and the team have been brilliant from start to finish.
“People right across the country have been glued to the telly cheering the team on – with some very late nights as a result.
“There have been heroic efforts throughout the team and the results we’ve seen are testament to the hard work and dedication they, their families and their coaches have put in.
“Their performances will have inspired the next generation of young talent coming through the ranks and I am sure the entire team will all be given a warm and rapturous Scottish welcome when they return home this week.
“Our athletes have done themselves and their country proud and they all deserve huge congratulations for their efforts. I hope they take time to enjoy the celebrations with friends, family and the public in the days ahead.”
Stewart Harris, Chief Executive of sportscotland, added: “The performances of the athletes in Team GB at the Rio Olympics have been absolutely phenomenal.
“And, by winning 13 medals the Scots at the Olympics have had their most successful ‘away’ Games. Their efforts have captured the imagination of the nation, and no doubt inspired the next generation to emulate their achievements.
“This success has not happened by chance. We have been building a world-class system at every level for many years.
“From schools and clubs, to the athletes performing on the world stage, we have been working with our partners to ensure the connections are there to give aspiring athletes a clear pathway to progress in their chosen sport.
“This has been an extremely successful period for Scottish athletes on the world stage. From the Olympics and Paralympics in London and Sochi, to the incredible medal haul of Team Scotland in Glasgow, and now the best ever overseas Games in Rio, with the Paralympics yet to come, it’s a very exciting time for Scottish sport.”