The ONS has introduced monthly measures of GDP and provides three-month rolling growth figures, rather than the quarterly figures it published in the past.

Data last month had shown the economy grew by 0.3% in July. This was revised up to 0.4%, as was the figure for June to 0.2%, which meant the three-month rolling figure to July was revised up from 0.6% to 0.7% – the same as the three months to August.

Andrew Wishart, UK economist at Capital Economists, said the three-month 0.7% figure was higher than the 0.6% expected because of upward revisions to earlier data.

“Rolling three-month growth in the services and construction sectors eased compared to July, but this was offset by industrial production recovering from its recent contraction,” Mr Wishart said.

Analysis:

By Simon Jack, BBC business editor

A three month growth rate of 0.7% looks pretty darn good for an economy generally forecast to grow somewhere between 1% and 1.5% for the whole year.

But as always, there is some salt to be pinched.

The three-month figure continues to be flattered by a strong showing from construction in June and July, caused by a bounce-back in activity after a weather-affected beginning of the year.

Next month, June’s strong performance from production, construction and manufacturing will drop out of the rolling three-month calculation.

The figures also show that the UK economy did not grow at all in August.

Now that is not the end of the world, as it means the economy didn’t shrink after a strong June and July.

In summary, it looks like the UK economy is on track to record a pretty good third quarter, but there will be no sound of corks popping in the Treasury.

The ONS said that growth was picking up from April, when data for the first quarter of the year was showing the weakest growth since 2012, only partly because of the cold weather.

The UK then had a heatwave, which the ONS has said helped to fuel growth in the retail sector.

Taking a longer-term view, the ONS said growth in the services sector – which makes up 80% of the economy – was subdued when compared with the same three months a year earlier.

According to the ONS:

Monthly growth in the services sector was flat, with accommodation and food shrinking after high growth in July. The three-month figure showed 0.5% growth.

Monthly production growth was 0.2%, but within that, manufacturing shrank by 0.2%. Over three months, growth was 0.7%.

The construction sector shrank by 0.7% in August and on a three-month measure grew by 2.9%. The ONS said the strong growth in this period partly reflected weakness in March and April.

Lee Hopley, chief economist at EEF, the manufacturers’ organisation, said: “The main takeaway from today’s bumper crop of releases on the economy is that the UK saw a spurt of activity in June and July not seen since the end of 2016. Beyond that, it seems that it’s back to business as usual more or less in August.

“The underlying services picture looks to be slow and steady, the construction sector has recovered its weather-related losses from earlier in the year and manufacturing weakness is persisting in the second half of this year so far,” Ms Hopley said.

John Hawksworth, chief economist at PwC, said the economy was on track for an annual growth rate of 1.5%. “This is somewhat below its longer-term trend rate of around 2% and reflects the continued drag on business investment, in particular from Brexit-related uncertainty,” he said.