Stockpiling ahead of Brexit was one of the main reasons for the Scottish economy growing at its fastest rate for two years, economists have claimed.

In the first three months of 2019, 0.5% growth was recorded across Scotland. A new report by the Fraser of Allander Institute said this was boosted by companies' contingency plans for a no-deal Brexit ahead of the then March 29 cut-off.

The report warns risks to the Scottish economy remain, including ongoing uncertainty over Brexit. In its latest economic commentary, supported by Deloitte, the institute revised up its central economic forecast for Scotland slightly to 1.2% for 2019.

The forecasts for the following two years remain static at 1.4% and 1.5%. The main scenario continues to assume an orderly departure from the EU.

Economists also modelled a range of other scenarios, including forecasting a 4.2% drop in 2020 if there is a no-deal Brexit with no policy response.

If an orderly Brexit occurs and business investment is unlocked, they forecast 1.8% growth that year.

The report states: "A positive scenario, where some form of deal is reached and uncertainty is reduced, could see growth surprisingly on the upside.

"No-deal outcomes - even where there is some co-ordinate policy response - will have a negative impact on Scotland's growth prospects."

The report warns the forecasts should be viewed with caution in the current climate of uncertainty.

Institute director Professor Graeme Roy said: "Three years on from the Brexit referendum, we still have little clarity over the timing or format of the UK's departure from the EU.

"Given the scale of the challenges that a no-deal Brexit might bring, it is no surprise that businesses are taking matters into their own hands by rolling-out contingency plans.

"Much of the Brexit debate has focused upon the potential dislocation of trade patterns. But arguably an even greater challenge, particularly over the longer-term, are the implications for Scotland's population."

He added: "Our analysis shows that a significant amount of the long-term growth gap between Scotland and the rest of the UK can be explained by differences in population growth.

"Should Brexit make migration to Scotland more difficult, or less attractive, then this could have serious implications for key sectors and the economy at large."

He also addressed the possibility of an emerging £1bn in income tax reconciliation cutting future Scottish Government budgets.

The report said Scottish income taxpayers are paying some £500m more then they would pay under UK policy but this has been completely offset by a weaker performance in the Scottish tax base.

"To call this a 'black hole' is an over-dramatisation," it says. "But the Scottish Government will have to find money to pay for these reconciliations.

"The lack of analysis so far from the Government to explain the causes of the gap or how they will respond has been surprising."

Prof Roy added: "At the heart of the framework is a risk that - with the exception of population - the Scottish budget bears the full cost of any divergence between Scottish and UK income tax performance, no matter its source or the ability of Holyrood to mitigate its impact.

"Whether or not the framework is sufficiently flexible to manage these and other risks is open to debate.

"At the very least, it deserves much more effective scrutiny than we have seen from Parliament in recent weeks."