Scotland's population forecast to go into decline
Scotland's population is projected to begin to fall before the end of the decade, experts have forecast
National Records of Scotland (NRS) estimates that the number of people in the country will peak in 2028 at 5.48 million and then fall by 1.8% by 2045.
The drop is driven in part by a reduction in net migration - the number of people entering Scotland minus the number of people leaving.
NRS published the figures in its annual population review.
Net migration peaked in 2007 at 33,000 but is predicted to remain below 20,000 in coming years after Brexit ended EU citizens' rights to move freely in and out of the UK.
On Tuesday, the Scottish Fiscal Commission (SFC) predicted that Scotland's population could fall by up to 900,000 over the next 50 years.
The Registrar General's annual review of demographic trends also points out that Scotland's population is ageing, with fewer babies being born and, over the long term, people living longer - although life expectancy actually fell during the pandemic.
NRS projects that by 2045 there will be 22% fewer children and 21% more people of pensionable age in Scotland.
The number of people of working age will remain roughly stable, down by about 2%, it adds.
Scotland's population shrinking and ageing simultaneously is likely to present significant challenges for the economy, with the SFC projecting that it will grow more slowly than the UK average.
"Scotland is the only UK country with a projected [population] fall by 2045," said Esther Roughsedge, head of population and migration statistics at NRS.
"Growth from migration would no longer offset the growing gap between births and deaths."
The statistics also confirm that mortality rates in 2021 were about two times as high in the most deprived areas of Scotland as the least deprived.
People in the poorest parts of the country were more than 15 times as likely to die from drug misuse as those in the richest, said the NRS.
Alcohol-specific deaths were more than five times higher in the poorest areas than the richest, it added.
The report noted that Covid-19 had accounted for 8% of all deaths during the pandemic so far but there were also excess deaths - deaths above the average for the previous five years - from other causes such as cancer and heart disease.
Julie Ramsay, head of vital events statistics at NRS, said: "Over the last 40 years, our overall life expectancy has improved and we're living longer than we used to.
"But our life expectancy is lower than the rest of the UK and many other countries in western Europe.
"In recent years, life expectancy improvements have stalled and started to reverse. Although this isn't unique to Scotland."