Image copyright Getty Images Image caption TV and film production has helped to boost the economy

The UK's economy is expected to avoid a recession after showing better-than-expected growth in the three months to the end of August.

The Office for National Statistics said the economy would now have to shrink sharply in September for the third quarter to show an overall contraction.

In three months, the economy grew by 0.3% as weak manufacturing was offset by buoyant TV and film production.

Even so, the economy unexpectedly shrank in the month of August by 0.1%.

Why the talk about a recession?

The growth figures are being watched closely for signs of recession - defined as two consecutive quarters of contraction - after the economy shrank in the second quarter for the first time since 2012.

The next quarter runs until the end of September so the August data is the second month in the third quarter.

Although the economy contracted in August, the ONS revised up its forecast for growth in July from 0.3% to 0.4%.

Andrew Wishart, UK economist at Capital Economics, said that this revision meant "fears that the economy is already in recession have been banished".

The ONS said the economy would now have to contract by 1.5% in September alone for the UK to slide in to recession.

What happened in the latest three months?

The ONS uses the monthly data to compile a rolling three-month picture of GDP.

It said that in the first half of 2019 the data had been volatile because of preparations for the original Brexit date in March, which had sparked some stockpiling.

Rob Kent-Smith, head of GDP at the ONS, said: "Growth increased in the latest three months, despite a weak performance across manufacturing, with TV and film production helping to boost the services sector.

"Services provided [the] majority of the growth over the three months, with production and manufacturing falling back," he said.

Over the three months the services sector - which makes up roughly 80% of GDP - grew by 0.4%, following a period of largely flat growth in the previous three months.

The ONS said the production sector fell by 0.4% in the same period, while construction output grew by 0.1%.

So why did the economy shrink in August?

For August, economists had been expecting zero growth.

But the ONS data showed it contracted, dragged lower by a drop in manufacturing when car production was subdued.

Only the construction sector expanded during the month, said Chris Williamson, chief business economist at IHS Markit.

Manufacturing contracted by 0.7% while the all-important services sector failed to grow.

He described the August data as "disappointing".

Did The Crown save the UK from recession?

TV and film production - such as filming of The Crown - enabled GDP to grow by 0.3% in the three months to August, more than compensating for activity languishing across the board in that month alone.

But that is not sufficient reason to cheer.

As the Bank of England has highlighted, growth has lost momentum over the past year and the economy is limping rather than flying.

Part of this is undoubtedly Brexit related - with business investment suffering amidst the prolonged uncertainty. A failure of firms to spend on factories and machines will have long-reaching implications. This is one reason why economists are pulling down their forecasts for next year too.

But it is also unhelpful that growth in some of our biggest trading partners, such as Germany, has run into problems. The bright spot remains job creation - but that too could falter.

This sluggishness ignited a mood shift among policymakers. Even those members of the Bank's interest rate panel who previously favoured a rise in the cost of borrowing now think their next move could be a cut - deal or no deal.

The question for them, grappling with as much uncertainty as the rest of us, is when.

What does it mean for the future?

The data sparked some economists to revise up their expectations for the third quarter.

Mr Wishart said the the economy could grow by 0.4% in the third quarter, more than he had originally expected.

However, John Hawksworth, chief economist at PwC, said that while the data "has put to bed fears of the UK economy falling into recession in the third quarter of 2019", he was cautious about the future.

He said there could be "problems ahead in the fourth quarter as heightened Brexit-related uncertainty takes a toll on both business investment and consumer confidence."

Uncertainty about Brexit was also mentioned by Mr Williamson. who expects the UK to expand by 1% in 2019 but by just 0.5% in 2020.

"These growth projections assume a Brexit delay beyond 31st October and that the UK and EU will eventually achieve a comprehensive agreement on future relations. However, a no-deal Brexit would likely throw the UK into a prolonged recession," he said.