Scotland enjoyed a record-breaking year for foreign direct investment (FDI) in 2016, and retained its position as the top location in the UK outside London with FDI increasing by 2.5% on 2015.

But there are concerns that the impact of Brexit will have a damaging long term effect.

According to the latest annual survey on the attractiveness of locations to international business published by Ernst & Young, Scotland now takes more than 1 in 50 of all investment projects in Europe; “a clear indication that Scotland is now firmly established as a location of choice for global investors”, said Scottish Development International in a statement.

As well as highlighting the record level of projects won by Scotland, the 2017 EY Scotland Attractiveness Survey shows that Scotland 2016 was also a strong year for attracting research and development inward investment; with 21 individual projects, Scotland has retained its position as number one in the UK for R&D projects.

But the welcome news comes with the caveat that many of these decisions were taken up to three years before last summer’s vote by Britain to leave the EU and this is likely to impact on future plans.

Mark Harvey, EY senior partner in Scotland, voiced caution over the longer term outlook.

“The research suggests that the EU Referendum vote and its aftermath may be having an influence on global perceptions of the UK’s medium to long-term attractiveness. Western European investors are twice as negative as Asian and North American investors.

“Decisions on the majority of investments made in 2016 would have been made up to three years ago, which helps to explain the UK’s solid performance last year, but signs of a slowdown are on the horizon.”

The EY study found 31 per cent of investors expect the UK’s attractiveness for FDI will decline over the next three years and nine per cent of investors said the UK’s exit from the European Union may prompt them to change investment plans or shift their investment plans to Europe.

Gordon MacIntyre-Kemp, CEO of Business for Scotland said: “Scotland’s performance has been increasingly strong over the past few years, but Brexit offers a real risk to future deals and threatens the longer term future of FDI and the resulting effect that will have on the Scottish economy.

“Scotland voted to remain in the full knowledge that a Brexit – hard or soft – would have a damaging impact on our economy, and once the outcome of the EU negotiations becomes clear then the impact of Brexit on Scotland economy will lead many to a complete reassessment of where Scotland sits on both economic and constitutional issues.”

The report shows that Scotland secured the UK’s second-highest number of projects in every one of the past five years, demonstrating Scotland has established itself as the second most attractive destination in the UK behind London. The data for 2016 also places Aberdeen, Glasgow, and Edinburgh within the UK’s top 10 cities for attracting FDI.

Mark Harvey said: “Insight from investors indicates there may be a shift towards more London-centric investment in the future, which suggests Scotland needs to take action to ensure it secures a healthy share of FDI into the UK. Scotland has firmly secured its position as an attractive destination for FDI in the UK, with a further increase of projects from the record-breaking surge of inward investment in 2015.”

Glasgow achieved a 27% increase in FDI projects (28 in total) to maintain fifth place behind London, Manchester, Birmingham and Belfast.

Edinburgh follows closely in sixth with 27 projects, falling three places. In contrast, Aberdeen has bounced up from tenth to seventh position with projects doubling to 18, signalling a rebound in offshore activity.

The leading sectors generating FDI into Scotland were the service sector with 17 projects (an increase of 42% from 2015), construction which had 14 projects (representing an increase greater than three-fold), closely followed by software with 13 projects. Software is a particularly strong area for Scotland as it is now second only to London in securing investments from the software industry, overtaking the South East of England with 12.