The UK economy picked up pace in the run-up to the Brexit vote thanks to the strongest performance from industrial production since 1999.
The Office for National Statistics (ONS) said gross domestic product (GDP) grew by 0.6% in its initial estimate for the second quarter, up from 0.4% in the first quarter of 2016.
The higher-than-expected figure was driven in part by a swing in industrial production, which rose 2.1% over the period - matching figures last seen 17 years ago - compared with a 0.2% fall in the quarter before.
Britain's dominant services sector, which accounts for more than 78% of the UK economy, grew by 0.5% in the second quarter, edging down from 0.6% in the first three months of the year.
However, economic growth was hampered by construction and agriculture, which fell 0.4% and 1% respectively over the period.
The GDP update came as separate figures for the services sector showed that output slipped by 0.1% between April and May, down from a 0.6% rise the month before.
ONS chief economist Joe Grice said uncertainty in the weeks leading up to the referendum had "limited effect" on the economy, with only a small number of companies surveyed by the organisation saying it had negatively impacted their business.
He added: "Continued strong growth across services, particularly in retailing, reinforced by healthy growth in the manufacture of cars and pharmaceuticals, boosted output in the second quarter."
The rise in GDP came in above economists' expectations of 0.5% growth, with many tipping the economy to maintain momentum ahead of Britain's vote on the European Union.
Chancellor Philip Hammond said the GDP figures showed the fundamentals of the UK economy were strong.
He added: "We saw the strongest quarterly rise in production for nearly 20 years, so it is clear we enter our negotiations to leave the EU from a position of economic strength."
However, the latest economic data since the referendum suggests dark clouds are gathering over the UK economy, with Friday's flash PMI survey showing economic growth had slumped at its fastest rate since the financial crisis.
Companies also revealed a gloomy outlook for trade in the latest CBI Industrial Trends Survey on Monday, with business optimism deteriorating at its fastest rate since January 2009.
Some economists have suggested Britain could be heading towards another recession.
Martin Beck, senior economic adviser at think-tank EY ITEM Club, said the second quarter GDP growth represented "one last hurrah for the economy" before it is hit by a bout of turbulence.
He said: "The lack of momentum as the economy entered the third quarter means that the chances of a negative reading for the current quarter are relatively high.
"However, our view remains that the extent to which the economy will slow in the second half of the year has been overplayed and that the UK may avoid a technical recession."
Surveys pointing to a sharp post-referendum contraction caused Bank of England policy-maker Martin Weale to shift his stance on Wednesday in favour of measures to shore up UK economic growth.
Mr Weale, a member of the Bank's Monetary Policy Committee (MPC), is eyeing an interest rate cut or an expansion in quantitative easing when the Bank reviews the cost of borrowing on Thursday August 4.
Samuel Tombs, chief UK economist for Pantheon Macroeconomics, said: "The second quarter's GDP figure is not as robust as it seems at face value and it won't hold back the MPC from cutting interest rates next week."
He added: "The collapse in all surveys of activity and confidence undertaken since the referendum suggest GDP is on course to contract in the third quarter.
"The outlook for above-target inflation in 2017 and 2018, however, due to sterling's depreciation, suggests that the MPC probably will just cut interest rates to 0.25% from 0.5%, and hold back from unconventional stimulus measures for now."
The Bank kept interest rates on hold at 0.5% this month, where they have remained since March 2009.