Scotland's population has risen to its highest level since 1977, according to new estimates.
Last June, a total of 5.22 million people were living in the country - a rise of 28,100 on the previous year - the National Records of Scotland said.
The increase was due partly to the fact that 5,200 more people were born than died - the largest natural increase since 1991-92.
The rise was also due to immigration exceeding emigration by 25,000.
Over the 10 years between mid-2000 and mid-2010, the population increased by 3.1% from 5.06 million to 5.22 million.
In the year to June 2010, there was a net migration gain of 25,000 people.
This included net gains of 3,300 people from the rest of the UK, 21,500 people from overseas (including asylum seekers) and 200 people from the armed forces.
A total of 46,100 people (including asylum seekers) came to Scotland from overseas and 24,600 left Scotland to go overseas.
This net increase, of 21,500, was the highest since estimates began in 1991-92.
The number of people coming to Scotland from overseas was also the highest since that year.
From about 1975 to 2005 there has been a gentle population decline hen it started to rise slowly but surely, part of that was fuelled by a natural increase but there was also much more in-migration than out-migration.
Among council areas, between mid-2009 and mid-2010, Edinburgh had the largest percentage population increase at 1.8%, followed by Aberdeen City (1.6%), Perth & Kinross (1.3%) and Stirling (1.3%).
Argyll and Bute had the largest percentage population decrease at 0.9%, followed by Inverclyde (0.6%) and West Dunbartonshire (0.4%).
On average, there were 67 people per square kilometre in Scotland, ranging from nine people per square kilometre in Eilean Siar (Western Isles) and Highland Council areas to 3,378 people per square kilometre in Glasgow City Council area.
The average population density for the UK in the middle of 2009 was 255 people per square kilometre.
Scotland's highest ever population was 5.25 million in 1974.
It had fallen to about 5.05 million by 2002.
Every time these figures are published, I raise an eyebrow at the careful inclusion of the count of a few bodies from the armed forces - it could swing wildly in either direction at the drop of a hat, and could be out of date five minutes after being evaluated.
Agree with Apollo above that the population count swings, the population will increase by two when the Wanlocks return for the annual leave, and at end of August will decrease by same amount. How is the population counted ?, we have a house in scotland and on the voters role, is that one way, or is it wet finger, stick in air and guestimate.