Output expanded by 6.6% in July from June, helped by the further lifting of restrictions in sectors such as pubs, bars and restaurants.
Economists polled by Reuters had expected growth of 6.7% in July.
"While it has continued steadily on the path towards recovery, the UK economy still has to make up nearly half of the GDP lost since the start of the pandemic," ONS statistician Darren Morgan said.
The pound fell against the dollar as the data showed output in the dominant services sector was a bit weaker than expected, growing by 6.1% in July against expectations for growth of 7.0%.
Growth in the much smaller manufacturing and construction sectors exceeded forecasts.
(Reporting by Andy Bruce and Paul Sandle; Editing by William Schomberg)
(Only the headline and picture of this report may have been reworked by the Business Standard staff; the rest of the content is auto-generated from a syndicated feed.)