Scotland’s public finances improved last year, with an increase in revenue and a reduction in the deficit, according to the latest official figures.

Government Expenditure and Revenue Scotland (GERS) statistics for 2017/18 show the country spent £13.4 billion more than it raised, when a geographic share of North Sea revenues is allocated to Scotland.

This represents 7.9% of Scottish GDP – down from 8.9% the previous year.

First Minister Nicola Sturgeon said the statistics showed Scotland was “on the right trajectory”.

However, opposition parties pointed out that the deficit is four times higher than that of the UK as a whole, with the UK figure standing at 1.9% of GDP.

Scotland’s finances were boosted by an increase in Scottish North Sea revenue, up from £266 million in 2016/17 to £1,327 million in 2017/18.

Meanwhile, onshore tax take increased by £2 billion, taking total revenue to £60 billion.

Including an illustrative geographic share of North Sea revenues, Scottish public-sector revenue is the equivalent of £11,052 per person and about £306 per person lower than the UK average.

Meanwhile, the statistics show public spending in Scotland increased from £71.4 billion in 2016/17 to £73.4 billion in 2017/18.

This is equivalent to 9.3% of total UK public sector expenditure, and £13,530 per person, which is £1,576 per person greater than the UK average.

Ms Sturgeon said: “Looking at the wider economic picture, these figures – along with recent labour market stats, labour productivity and GDP figures – show that Scotland is on the right trajectory.

“It also demonstrates that our commitment to sustainable economic growth is the right one and we will continue to stimulate our economy in this way to reduce the deficit.

“With the limited economic powers currently at our disposal, the actions we are taking to promote sustainable economic development are helping to ensure that the key economic indicators are moving in the right direction.”

Scottish Secretary David Mundell described the level of Scotland’s deficit compared with the UK figure as “concerning”.

He said the figures “also confirm that being part of a strong United Kingdom – the fifth largest economy in the world – is worth nearly £1,900 for every single person in Scotland, which supports vital public services”.

“Simply put, Scotland contributed 8% of UK tax, and received more than 9% of UK spending for the benefit of families across the country,” he added.

Scottish Conservative finance spokesman Murdo Fraser said: “If Nicola Sturgeon wants to continue her threat of second referendum, she has to come out and explain where she would find £13 billion to fill this deficit.”

Scottish Labour leader Richard Leonard said: “People across Scotland are sick and tired of austerity – and these figures show that the SNP’s plans for independence would mean unprecedented levels of austerity for Scotland.”

Scottish Liberal Democrat Leader Willie Rennie: “Whichever way you look at it, under nationalist plans all the good things we all want to do in Scotland would be under threat because of funding cuts.£