Scotland still in the red, but by less than last year.
The annual figures on how much Scotland spends and earns have been released.
Scotland's deficit fell to £13.3 billion for 2016/17 amid an increase in oil and gas revenues, according to new figures.
The Government Expenditure and Revenue Scotland (GERS) statistics show a deficit of £13.3 billion when a geographic share of North Sea revenues is allocated to Scotland.
That amounts to 8.3% of Scottish GDP, compared with the overall UK deficit of £46.2 billion - 2.4% of UK GDP.
North Sea revenue rose from £56 million in 2015/16 to £208 million, reflecting an increase in total UK oil and gas revenues.
The figures also show Scotland's onshore revenues increased by £3.3 billion.
According to the latest report, Scotland's deficit fell by 31.3 billion from 2015/16, down from 9.3% of GDP to 8.3%.
First Minister Nicola Sturgeon said: "Scotland's economy remains strong. In the last quarter, our economy grew nearly four times faster than the UK and the number of people in employment is at a record high.
"These figures reflect Scotland's finances under current constitutional arrangements. However, they show that our investment in key industries, such as the life-science sector, is providing a real boost to our onshore economy. By continuing to invest in key sectors, we will ensure Scotland remains a productive and competitive country.
"The lower oil price had an impact on North Sea revenues and the wider economy last year. However, it is encouraging to see an improvement in the overall fiscal balance and that onshore revenues grew at their fastest rate in nearly twenty years.
"However, our long-term economic success is now threatened by Brexit, which risks reducing household incomes, employment and funding for public services. That is why we continue to press for the Scottish Government to have a direct role in Brexit negotiations.''
Scottish Secretary David Mundell said: "These figures from the Scottish Government are a cause for concern, and show clearly there is still much to be done to improve Scotland's economy.
"They also highlight the value of pooling and sharing resources around the UK. Being part of a strong UK has protected our living standards, and that's one reason the people of Scotland clearly rejected Nicola Sturgeon's plan for a second independence referendum at the election.
"Scotland's deficit is falling at a slower rate than the UK as a whole and economic growth is lagging behind. It is vital we grow the economy and we want to work with the Scottish Government to achieve that.''
Scottish Labour leader Kezia Dugdale said: "These figures prove once and for all that the SNP sold false hope to the poorest people in Scotland. The real hope is with a Labour government.
"Scotland's own accounts show that the first year of an independent Scotland would have meant unprecedented levels of austerity.
"These cuts would not only have been the largest ever felt by Scottish public services like schools and hospitals, the Nationalists' plan would have taken a sledgehammer to the welfare state as we know it.''
Scottish Liberal Democrats leader Willie Rennie called on the Scottish Government to explain why oil revenue estimates in its White Paper on independence were "so hopelessly wrong''.
He said: "Oil revenues have tanked since 2014. The SNP relied on the 2014 numbers for their independence campaign.
"People need to know why they got it so wrong to make sure the same mistakes can't happen again.''
Green MSP Patrick Harvie said: "Every year these figures set off a tiresome war of words between those who think Scotland could never run its own affairs and those who think the SNP approach is flawless.
"What these figures really show is that Scotland needs to build a clean economy that does not rely on oil and gas.'