Scotland's population reached its highest-ever level at more than 5.3 million last year.
By mid 2014 the number of people had risen by 19,900 on the previous year as more people were born than died, and more people moved to Scotland than left.
Between mid 2013 and mid 2014, about 49,240 people came to Scotland from the rest of the UK while 39,660 left Scotland to go in the opposite direction, giving a net migration gain of approximately 9,600, according to figures from the National Records of Scotland (NRS).
During that period, 33,200 people came to Scotland from overseas and 25,200 left Scotland to go overseas, boosting the country's population by 8,000.
Other changes, such as in armed forces and prisoners, resulted in a loss of around 1,200 people.
In addition, about 3,500 more people were born than died between mid 2013 and mid 2014, taking the country's estimated population to 5,347,600.
There were approximately 2,596,384 males and 2,751,216 females.
The NRS statistics published today also showed that migrants to Scotland tended to be younger than the general population, with more than two-thirds of migrants from overseas and nearly half of migrants from the rest of the UK aged between 16 and 34.
In the resident population as a whole, only a quarter were in this age group.
Meanwhile, only seven per cent of people coming to Scotland from the rest of the UK and one per cent of people arriving from overseas were aged 65 and over.
The average age of Scotland's population was lower in the big city areas than in more rural council areas, the statistics showed.
It was 35 in Glasgow City and 36 in Aberdeen City and the City of Edinburgh while in more rural council areas such as Argyll & Bute, Dumfries & Galloway, Eilean Siar, the Scottish Borders and South Ayrshire it was 47.
According to the figures, the population increased in 23 council areas and decreased in nine council areas.
Midlothian had the largest percentage population increase at 1.8% while Inverclyde had the largest percentage population decrease at -0.6%.
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules hereComments are closed on this article