The population of Scotland was given as 5,295,000, up five percent on the 2001 census and a new high.
The census, carried out across the UK on March 27 last year, found that in Scotland, the number of adults aged over 65 grew by 11 percent, but the number of children aged between five and 14 fell by the same percentage.
Scotland's population in 2011 was just over half a million (11 percent) higher than a century earlier in 1911.
"These first results from the census confirm the upward trend in the size of Scotland's population in recent years," said acting registrar general Audrey Robertson.
"At 5,295,000, the population is now the highest ever recorded. This increase is partly because there have been more births than deaths, but mainly because more people have moved to Scotland than have left."
Scotland will hold a referendum on independence from Britain in 2014, which could end the 300-year-old union of the two nations.
According to census figures published last week, the combined population of England and Wales swelled by 3.7 million to 56.1 million between 2001 and 2011 due to an influx of immigrants.
The population of England is 53 million, Wales 3.1 million and Northern Ireland 1.8 million.