Scottish GDP grew by 0.5% in real terms between April and June 2018, a marginal increase on the 0.4% the previous quarter.
The UK economy grew 0.4% in the second quarter of 2018.
Across Scotland in this period output in the construction sector grew by 1.8%, production by 0.6% and the services sector by 0.4% while agriculture fell by 1.2%.
Scottish economic growth for the first half of 2018 at 0.8% is higher than the 0.7% growth forecast the Scottish Fiscal Commission projected for the whole of 2018.
In the year since the second quarter of 2017, the Scottish economy has grown 1.7%, while the equivalent growth UK-wide was 1.3%.
Scottish Finance Secretary Derek Mackay, said: “These are welcome figures which show that Scottish growth is both pulling ahead of the UK, and outperforming the official growth forecast.
“The Scottish Government is focused on building on the country’s strong economic foundations, supporting businesses to stimulate growth jobs and investment.
“Our Programme for Government includes an ambitious package of measures to ensure we are delivering for the economy of today and ready to seize the opportunities of the future.”
He also warned of the risk Brexit poses to the economy.
Scottish Secretary David Mundell said: “It is welcome news that Scotland’s economy continues to grow. However, we cannot be complacent.
“Scotland’s economic performance is still struggling to close the gap with the UK economy which has opened up over recent years.
“I urge the Scottish Government to focus on growing Scotland’s economy.”
Analysis by economist John McLaren highlighted Scotland’s 1.1% annual GDP growth rate post 2010, almost half of the UK growth of 2% a year in the same period.
He said: “Scotland continues to perform relatively well in 2018. It is particularly welcome to see that much of this growth has returned to the ‘active’ side of the economy, including manufacturing and most private sector services.
“However, Scotland’s longer term GDP growth performance continues to disappoint, despite recent data revisions.
“While the recent uptick in output over the last six months is welcome it does little to redress past failings and its source remains largely a mystery, as too does the causes of past underperformance.
“Even at the higher growth rates seen in the past two quarters Scotland is still only looking at a growth rate of around 1.5% for 2018 as a whole.”