Scotland's population was at its highest level last year as a result of increased migration.
New figures from the National Records of Scotland show an estimated 5,373,000 people were living in Scotland as of June last year, an increase of 25,400 from the previous year.
READ MORE: Nicola Sturgeon unveils £100m 'stimulus' plan in bid to bolster post-Brexit economy
The figures show 85,000 people came to Scotland in the year to mid-2015 while 57,000 left, giving a net gain of 28,000.
The gain compares to 17,600 in the previous year and is the highest net in-migration figure since the year to mid-2011.
Of those who came to Scotland, the majority, about 47,200, were from England, Wales and Northern Ireland while around 38,800 people left Scotland for the rest of the UK.
Over the same period, around 37,800 people arrived from overseas and about 18,200 left to go abroad.
Migrants tended to be younger than the general population, with a peak age for inward migration of 19 and peak ages for migration out of 23 and 24, reflecting students starting and completing higher education in Scotland.
Statisticians estimate that, based on past trends, the population of Scotland will rise by 7 per cent to 5.7 million by 2039, compared with 17 per cent for England, 10 per cent for Northern Ireland and 6% for Wales.
Tim Ellis, the Registrar General of Scotland, said: "Most of that increase for Scotland is projected to come from net in-migration rather than from natural change."
He said the projections did not take into account recent political developments, such as the vote to leave the EU, but added: "It's noticeable that even in a low-migration scenario the population is expected to be very slightly bigger in 2039 than it is now."
Mr Ellis said there was likely to be a "significant structural shift" in Scotland's population if current trends continue.
The population is projected to grow older as life expectancy improves, with the number of people aged 75 and over increasing by 85 per cent, from 0.43 million in 2014 to 0.8 million in 2039.
The figures show that in 2015 there were 55,098 births registered in Scotland, 1,627 (2.9 per cent) fewer than in 2014, resuming a trend of decline.
The average age of mothers has increased from 27.4 in 1991 to 30.2 in 2015, with the percentage of babies born to unmarried couples 51.2 per cent compared to 33.7 per cent in 1995.
Meanwhile, there were 57,579 deaths registered during the year, an increase of 3,340 (6.2 per cent) on 2014.
The main causes of deaths in Scotland were cancer (16,093), respiratory diseases (7,669) deaths and ischaemic (coronary) heart disease (7,142).
READ MORE: Nicola Sturgeon unveils £100m 'stimulus' plan in bid to bolster post-Brexit economy
Mr Ellis added: "The population in 1855 was 2,978,065. This year's figures show our population is still increasing, mostly due to migration, and in 2015 was at its highest ever at 5,373,000 people.
"The population is continuing to age and this change will bring both opportunities and challenges in the years ahead.
"Although mortality rates in Scotland have generally fallen more slowly than in the rest of the UK and elsewhere in Europe, the improvements over the last 60 years are still considerable and the impact is reflected in the increase in expectation of life. Despite these improvements, inequalities remain within Scotland.
READ MORE: Nicola Sturgeon unveils £100m 'stimulus' plan in bid to bolster post-Brexit economy
"For example, males born around 2012 in the 10 per cent least deprived areas in Scotland could expect to live 12.5 years more than males born in the 10 per cent most deprived areas."
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