Scottish exports rise faster than rest of UK
Scotland last year remained the only part of Britain with a surplus in traded goods, according to the latest data from HM Revenue and Customs.
Exports of goods were up by 19% to nearly £29bn, while they rose 13% for the UK as a whole.
Imports to Scotland rose by 12% to more than £24bn, a faster rate than the UK's 10%.
Northern Ireland also registered a surplus in goods trade. Its exports rose £8.6bn, and imports were £7.4bn.
Scotland's trade figures partly reflect oil and gas exports.
The category of "mineral fuels"' rose in value by 45% to £9bn during 2017, as the price of oil firmed.
In 2014, when the oil price began a steep fall, fuel exports were £12.3bn, before falling to £7bn in 2015 and £6.2bn in 2016.
Fuel was also the fastest growing category of imports to Scotland, up 59% to £4bn.
The larger category of imports was "manufactured and transport" up by 4% to nearly £10bn.
Last year was the first full year of data since the Brexit referendum triggered a slide in the value of the pound, making British exports seem cheaper to foreign buyers.
It should have made British goods compete more effectively in their home market against imports.
The biggest single destination for Scottish exported goods was the Netherlands, where the Port of Rotterdam is the destination of many oil tankers.
The biggest single source of imports was Norway, followed by China and the United States.
Keith Brown, the Scottish government's economy secretary said the figures were welcome, "in spite of the looming shadow of Brexit".
"There was welcome news for oil and gas, with the increase in exports clearly demonstrating that confidence is returning to that sector - which is of course one of Scotland's most important industries," he said.
"Of course the stats also highlight the importance of the EU as a trading partner, with 49% of our goods exported to our European neighbours last year. It is interesting to note that the Netherlands overtook the USA as Scotland's largest export partner - with £4.3bn in goods being sent to the lowland country".
Trade statistics for other regions and nations showed the largest trade surplus were in the south-east of England. London and the South-East region combined had £152bn of imports, with £65bn in exports.
Those numbers are enlarged by the role of head offices, where some figures are allocated.
The HMRC statistics also highlight the relatively low number of companies in Scotland that are exporting.
Much of the activity is carried out by large firms in whisky, food and the energy sector, and increasing the number has been identified as a target for the Scottish government and Scottish Enterprise.
Out of nearly 154,000 companies exporting from the UK last year, it is estimated that only 8900 were Scottish firms. Nearly as many Northern Irish companies were selling in foreign countries.
The English regions comparable to Scotland in scale include Yorkshire and Humberside, where 12,000 firms were exporting, and north-west England, with 15,800.
The UK runs a large trade surplus in services.