Scotland's economy shrank by 0.2% in the last three months of 2016, official figures have revealed.
Finance Secretary Derek Mackay said the contraction in GDP over the period October to December resulted from the " economic reality of the Brexit vote" in June 2016.
He insisted that despite "challenges" such as a slump in North Sea oil and gas, the "foundations of our economy are strong".
Revised figures published by the Scottish Government showed economic output increased by 0.1% over the period July to September 2016 before then falling by 0.2% in the final three months of the year.
If the next GDP figures for the period January to March 2017 also show output shrinking, Scotland will be deemed to be back in recession.
In contrast, the UK economy grew by 0.7% over the period October to December 2016.
Comparing this period to the fourth quarter of 2015, Scotland's economic output was flat, the data showed, while the UK experienced growth of 1.9%.
Over the 12 months of 2016, Scottish GDP grew by 0.4%, with this lagging behind the 1.8% increase that was seen across the UK as a whole.
Mr Mackay said: "Scotland's economy faces continued headwinds, such as the slowdown in the oil and gas sector and weak global demand."
He added: "Despite these challenges, the foundations of our economy are strong with growth in 2016, unemployment falling and early signs that the situation is improving for North Sea operators.
" Before the EU referendum, the UK Government told us Brexit will make us 'permanently poorer'. What is now quite clear is the economic reality of the Brexit vote.
"We have already seen significantly lower consumer confidence in Scotland since the vote last summer.
"Now we see that feeding through into our growth figures and all of this is before the UK actually leaves the EU."