Image copyright Getty Images Image caption Although the population is aging, life expectancy is no longer showing clear progress

Life expectancy improvements have stalled, according to a report from the National Records of Scotland.

It said the change came after three decades in which Scottish residents have been living longer.

The Annual Review of Demographic Trends also points out that Scotland's fertility rate is the lowest in the UK.

Recent increases in population, although slowing for the second year running, have been driven by migration.

The health factors said to be contributing to life expectancy beginning to dip include:

Slower improvements in reducing deaths from heart disease

An increase in drug-related deaths

The most recent figures indicate a baby girl born in Scotland can expect to live for 81 years.

A boy can expect to live for 77 years.

Registrar General for Scotland Paul Lowe said: "This year's review shows that there have been changes in Scotland's life expectancy and mortality trends.

"Life expectancy in Scotland has been increasing over the long term, but recent estimates indicate that it has stopped improving.

"The largest causes of the stall in life expectancy are the slowing of improvements seen in the reduction of deaths from heart disease and increases in drug related deaths."

The two most common causes of death are ischaemic heart disease - responsible for 11.3% of all deaths - closely followed by dementia and Alzheimer's disease, responsible for 11.1% of deaths.

For younger people, the leading cause of death for those aged 20-49 years is listed as accidental poisoning.

Although the number of deaths from many of these causes has declined over time, the rate of decline has tended to level off.

The report says deprivation and health are closely linked, with those in less deprived areas expected to live longer and healthier lives.

Men in the least deprived section of the population can expect to live 22.5 years longer in good health than those in the most deprived. For women, the gap is slightly greater, at 23 years.

Mr Lowe said the overall population continued to increase.

He explained: "For the 18th consecutive year, Scotland's population has increased and now stands at a record high of 5.44 million.

"Migration continues to be the main driver of Scotland's population growth, with more people coming to Scotland than leaving.

"However, we have seen our population growth slowing over the past two years. This is due to the combined effect of a fall in net migration, fewer births and more deaths."

What were the main points in the report?

Scotland's population continues to increase and is at its highest ever at 5.44 million. Migration is the main driver of Scotland's population growth. However, the rate of population growth has slowed for the second year running.

Population change varies across Scotland. Over the latest year to mid-2018, the population increased in 18 council areas of Scotland while 14 council areas ( mostly rural, island and in the west of Scotland ) decreased in population - three more than in the previous year.

) decreased in population - three more than in the previous year. Life expectancy in Scotland has increased over the past three decades, but has stalled in recent years. The slowing in improvement to life expectancy can be seen across all UK countries.

Deprivation strongly affects life expectancy and has an even greater effect on healthy life expectancy.

Scotland's total fertility rate is the lowest in the UK and falling at a faster rate than all other UK countries.

The stillbirth rate has fallen to its lowest ever level in 2018 and the infant death rate equalled its lowest ever level.

Within the overall numbers, Scotland's population continues to age.

Between 2008 and 2018, the proportion of the population over the age of 65 increased from 16% to 19%.

The report highlights regional variations in the population figures.

A total of 18 local authorities saw a population increase, with the 14 others experiencing de-population.

Image copyright Getty Images Image caption Scotland has the lowest fertility rate in the UK

The largest increases were in Midlothian, City of Edinburgh, and East Lothian.

De-population was most significant in Inverclyde, Argyll and Bute, and Aberdeen City.

The low fertility rate is measured by the number of births registered in Scotland.

The 2018 total of 51,308 represents a 3% decline on the 2017 figure.

People appear to be having children later in life. The average mother in Scotland is now over 30, the average father is 33.

The Scottish government has highlighted what it sees as the importance of migration for Scotland.

Culture Secretary Fiona Hyslop said: "While Scotland's total population is the highest it's ever been, and it is welcome that people are living longer, we face a number of challenges.

"Against a backdrop of a record fall in the birth rate, Scotland's population is ageing with a shift in population from the west to east and declining population in rural areas.

"With all of Scotland's population growth predicted to come from migration, the impact and risk of Brexit means that we may not have a large enough working age population to support public services, industries and our economy."

Gerry McCartney from NHS Health Scotland said the stalling of life expectancy in Scotland was a "real concern".

He added: "The circumstances in which we live should not impact on health so much that the right to live a long and healthy life is compromised by how much money we have.

"Undoing the causes of poverty is essential if we are to address this decline, improve Scotland's health and ensure people live in good health, for longer."