Since 2017 to 2019, life expectancy began to fall, dropping by 18.2 weeks for females and 19.4 weeks for males.

The NRS said this was mainly because of Covid, but there were also increases in other causes of death, particularly circulatory conditions.

Its report also said life expectancy was “strongly linked” to wealth, with females in Scotland’s poorest communities living 10.5 years less than those in the richest. The gap for men was 13.2 years.

Broken down by local authority area, Glasgow city council had the lowest life expectancy for both women and men from 2021 to 2023 – 78.3 years for women and 73.6 years for men.

Neighbouring East Renfrewshire council had the highest life expectancy in Scotland, with women in the area expected to live 84.5 years and men 81 years. Overall, the figures were highest in remote rural areas and lowest in cities.

A Scottish Government spokesman said: “Today’s figures show a welcome increase in life expectancy – the highest annual improvement over the past decade.

“We’re determined to go further, that’s why we’re focused on action to drive improvements in population health which will help to tackle health inequalities.”