Statistics published by the National Records of Scotland (NRS) show the estimated population of Scotland was a record 5,373,000 in mid-2015, helped by a positive overall migration gain of 28,000 people.
Between mid-2014 and mid-2015, 37,800 people came to Scotland from overseas and 18,200 left Scotland to go overseas.
Over the same period, 47,200 people came to Scotland from the rest of the UK while 38,800 left Scotland to go in the opposite direction.
The NRS figures show a net rise of 25,400 people in Scotland between mid-2014 and mid-2015.
“The population increased because in-migration which includes people from the rest of the UK exceeded out-migration by approximately 28,000 people between mid-2014 and mid-2015,” the NRS report said.
“This was offset by approximately 2,000 more people dying than were born. Other changes, such as in armed forces and prisoners, resulted in a loss of approximately 500 people.”
In the year to 30 June 2015 there were more deaths than births for the first time since the year to mid-2006.