A surge in "tourist" weddings has helped the number of marriages in Scotland climb to a 10-year high.
Scotland has marketed itself as a wedding destination
The registrar general said the number of Scots couples getting wed also rose - possibly due to a change in the law.
Figures in his annual report showed that the total population rose by about 2,600 in 2003, when 9,000 more people moved to Scotland than moved away.
The number of births rose from 2002, but the fertility rate is below the UK average and is declining faster.
Registrar general Duncan Macniven said: "Our death rate, though better than a decade ago, rose slightly last year and remains stubbornly higher than the rest of the UK.
"Within the enlarged EU, only Estonia, Hungary, Lithuania and Latvia fare worse."
The main killers were cancer and ischaemic heart disease, which together accounted for 46% of deaths.
However, the number of infant deaths fell to an all-time low of 265.
Mr Macniven said that the slight rise in total population to 5,057,400 interrupted a downwards trend which had been evident since 1974.
There were 52,432 births in 2003, an increase of 217 on the all-time low seen in 2002.
He said that rise, and the fact that more people were moving to Scotland than were emigrating, represented good news for people who were "alarmed" at the prospect of demographic decline.
But he warned: "Population trends are hard to predict.
"Despite the small increase to Scotland's population last year, we face a challenge of a declining and ageing population in the future.
"Fertility rates remain lower than the rest of the UK and are declining faster."
It is estimated that the number of people living in Scotland will drop below five million in 2009.
Population decline has been described as "the greatest threat to the country's future prosperity" by First Minister Jack McConnell.
In February he unveiled a number of steps to tackle the problem through the Fresh Talent initiative, including visas which would allow foreign students to stay and work in Scotland after they graduate.
Mr Macniven's report dedicated a chapter to migration, which highlighted that 1.5% of the population in the year before the last census had migrated to Scotland.
"Students are an interesting group of migrants," he said.
"More people come to Scotland for their higher education than leave to study elsewhere.
"About 30% of students from the rest of the UK who studied in Scotland stayed here to work, and about 20% of students from the rest of the EU."
Within the UK, Scots tended to migrate to London and the south west, with people from Yorkshire, the Humber and the West Midlands making the reverse journey.
Scotland's population rose slightly in 2003
The population in Scotland's larger urban areas is declining, with the exception of Edinburgh, while there has been growth in rural communities and the areas surrounding cities.
The registrar general said there were some "interesting trends" in marriage.
"There were more weddings in Scotland last year than in any year since 1994," he said.
"The increase is mainly 'tourist' weddings, where neither bride nor groom is a Scottish resident. But, in 2003, the number of 'Scots' couples rose by more than 800.
"Perhaps that was the effect of a change in the law in 2002, which allowed civil marriages outwith registration offices - which now account for over 10% of all weddings."
The number of marriages in 2003 was still about 10,000 below the figures seen in the 1960s, he added.
Cardinal Keith O'Brien, from the Catholic Church in Scotland, welcomed the increase in the marriage rate.
He said: "It is reassuring to see that couples increasingly consider marriage as the most stable basis for a long term relationship and see it as providing the most secure environment for bringing up children."