Scotland's economy has contracted by 0.3% from April to June this year in the first quarterly decline since 2016.

Finance secretary Derek Mackay blamed Brexit and the UK Government for the fall in GDP, pointing to "volatility" caused by stockpiling in the manufacturing sector.

The Scottish economy grew by 0.6% in the first three months of the year, boosted by fast growth in the food and drink and pharmaceutical industries as they stockpiled for the previous Brexit deadline in March.

Now, the statistics for April to June show a "downturn in growth in these same industries, which may be the result of companies running down the stockpiled inventories", a government report said.

Scotland's GDP decline is marginally worse than the 0.2% drop suffered by the UK economy over the same period.

The UK Government accused Scottish ministers of holding the economy back "with threats of a second independence referendum".

The report by Scotland's chief statistician said the biggest reductions in growth "occurred in sectors which showed large increases in the previous quarter".

In the first three months of 2019, two sub-sectors of manufacturing (food and drink and pharmaceuticals) accounted for more than half of the total 0.6% growth.

This quarter, the drop in output from both of these sub-sectors accounted for the entirety of the 0.3% GDP fall

The chief statistician went on: "The previous growth was likely to be due to stockpiles being built or work being brought forward ahead of the original planned exit date from the European Union."

Compared to the same quarter in 2018, Scotland's GDP grew by 0.7%.

Commenting on the figures, the finance secretary said: "Given the repeated warnings from business organisations and the contraction across the UK in the same quarter, it is unsurprising, but deeply frustrating that we are now seeing the Brexit impact on the Scottish economy.

"The responsibility for this contraction lies entirely with the UK Government.

"There can now be no doubt that any form of Brexit will damage our economy and a no-deal Brexit would be disastrous for Scotland and could push the country into recession."

Mackay added: "Scotland did not vote for Brexit, but our economy is paying the price for it.

"We are likely to see continued volatility as businesses try and prepare for the looming October Brexit deadline and the increasing threat of a no-deal exit."

But Scottish secretary Alister Jack highlighted a recent increase in unemployment as proof "more needs to be done" at Holyrood to improve the economy.

Jack said: "I am concerned the Scottish economy has shrunk over the last quarter and continues to lag behind UK-wide figures.

"Coming on the back of disappointing unemployment figures, more needs to be done to boost our economy and close the gap.

"We will continue to work with the Scottish Government to boost the Scottish economy and create jobs.

"To date, the UK Government has committed £1.4bn in city and growth deals and we will seize all of the opportunities that will arise once we leave the EU."

He added: "I urge the Scottish Government to use the considerable powers at their disposal to improve the Scottish economy rather than holding it back with threats of a second independence referendum and the decision to make Scotland the most highly taxed part of the UK."