Goods exports from Scotland rose at a faster rate than the rest of the UK in the year to June, according to HM Revenue and Customs figures.
Exports amounted to £28.8bn, a rise of 7% compared with the same period the previous year.
The value of UK exports as a whole was up by 5.4%, at £331bn.
Scotland's increase was driven in part by an increase in the export of goods to the EU, which grew by 18% to £14.9bn.
Total UK exports to the EU increased by 7% over the same period.
Meanwhile, exports of oil and gas rose year-on-year by 29% to £7bn.
As a result, Scotland was the only part of Great Britain to show a surplus of goods exports over goods imports.
With its extensive trade across the Irish border, Northern Ireland also had a surplus.
The partial recovery in the energy sector has led to Norway becoming the biggest source of imports into Scotland, followed by China.
The HM Revenue and Customs figures do not include trade in services, such as accountancy, expertise in offshore energy or digital products, which make up by far the largest part of the economy.
Scotland's Economy Secretary Derek Mackay said: "Today's figures are again positive for Scotland, clearly showing strong export growth across a range of areas.
"The Scottish government continues to do everything in our power to support the Scottish economy and grow exports further, in spite of the uncertainty caused by Brexit.
"An export growth plan will see £20m invested in a range of measures, including support for 150 businesses to increase overseas activity."