The number of EU nationals in Scotland increased last year despite uncertainty over Brexit.

Official figures show the number of EU citizens living in Scotland rose by 26,000 to 235,000 in 2017.

Over the same period, the number of non-EU nationals increased by 14,000 to 142,000.

Combined, the number of non-British nationals living in Scotland rose by 12% to about 378,000, or 7% of the population.

The National Records of Scotland (NRS) statistics show Polish was the most common non-British nationality with an estimated 99,000 residents, or 26% of the total non-British population.

Also in the top five countries of origin were Ireland, India, Italy and Pakistan.

Aberdeen was the council area with the highest proportion of foreign residents, with 21% or 48,000 holding non-British nationality.

External affairs secretary Fiona Hyslop said: "These figures underline the key role inward migration plays in supporting further population growth across Scotland's communities and rural areas.

"As we face challenges in relation to the recent, welcome increase in life expectancy, migration flows to Scotland help us ensure we can grow our working-age population and support our social and economic needs, now and in the future."

She continued: "Scotland already benefits significantly from the contribution made by those who have chosen to live, work and study here, bringing new skills and expertise and helping to underpin future economic growth, and we are committed to doing all we can to ensure inward migration to our country can continue.

"However, the current UK Government's hostile immigration policy and unrealistic migration targets are detrimental to Scotland's economic growth and wider wellbeing.

"This is why, in our recently-published paper, we have set out the need for the Scottish Parliament to be granted devolved powers on migration.

"This would allow us to continue to grow our country's economy and tackle current demographic challenges while also creating a more welcoming environment for those migrants and their families who have chosen to make Scotland their home."