Image copyright Getty Images Image caption The service sector helped to boost growth in July

The UK's economy grew faster than expected in July, easing fears that it could fall into recession.

The economy grew 0.3% in July, the UK's official statistics body said, helped by the dominant services sector.

Growth was flat over the three months to July, but this was an improvement on the 0.2% contraction seen in the April-to-June quarter.

This contraction, coupled with some weak business surveys, raised concerns the UK was heading for recession.

An economy is generally deemed to be in recession if it contracts for two quarters in a row.

However, while growth in the services sector - which accounts for about 80% of the UK economy - helped to drive July's stronger-than-expected growth figure, the Office for National Statistics (ONS) warned that the sector remained weak.

"While the largest part of the economy, the services sector, returned to growth in the month of July, the underlying picture shows services growth weakening through 2019," the ONS said.

The pound rose in reaction to the figures, rising 0.6% against the dollar to $1.2357.

Pound v US dollar

The return to growth in the economy in the month of July will be a political relief for a troubled government keen to avoid recession headlines in early November. It makes unlikely the notion of another consecutive quarter of contraction between July and September, the definition of a recession.

But that does not make the economic reality rosy. In the three months to July, the economy did not grow. Even with a Q3 registering 0.3% growth, it would be the weakest first three quarters of a year since the financial crisis.

Over nine months, much of the volatility around no-deal - stockpiling effects and car industry shutdowns - should have been stripped out too.

There is some evidence in the figures that firms are beginning to restart stockpiling in anticipation of the rising possibility of no-deal Brexit next month.

It is difficult to predict how the current political impasse affects those patterns. But a prolonged squeeze on business investment was always going to hit productivity and growth.

The global context is far from benign too, with the German economy looking likely to be in recession and the eurozone as a whole growing sluggishly.

Other survey indicators for the UK look more difficult too. But if July's pattern continued last month and into this, the government should, when full Q3 figures are released in November, be able to avoid the R-word, for now.

'Under pressure'

The British Chambers of Commerce (BCC) also said that concerns remained.

"Although there was a rise in GDP between June and July, the zero growth recorded on the underlying three-month measure points to an economy under pressure from uncertainty over Brexit and weakening global economic conditions," said Suren Thiru, head of economics at the BCC.

"The manufacturing sector remains an area of concern, with tightening cash-flow, concerns over disrupted supply chains and weakening demand in key markets weighing on activity in the sector."

Last week, a series of downbeat surveys of various sectors of the economy had raised fears that the UK was at risk of slipping into recession.

However, analysts said the latest GDP figures appeared to have dampened these concerns.

"The pick-up in GDP in July is a reassuring sign that the economy is on course to grow at a solid - perhaps even above-trend - rate in Q3," said Samuel Tombs, chief UK economist at Pantheon Macroeconomics, adding that figures "substantially" weakened the case for any cuts in UK interest rates "before Britain's Brexit path is known".

"The upside surprise came from the services sector, which displayed broad-based strength and did not seemingly benefit from any one-off stimuli," Mr Tombs said.

Analysts also noted that August's growth figure should be boosted by car manufacturers, which were operating last month, contrary to normal practice. Many carmakers had brought their annual shutdown forward for the original Brexit date in March.

"GDP will get a further boost of about 0.2% in August, when car manufacturers will be at work when they are usually on holiday," said Paul Dales, chief UK economist at Capital Economics.

"Overall, the economy is still fairly weak - we estimate that the underlying pace of growth is around +0.2% quarter-on-quarter - but it's not in recession. Political chaos, yes. Economic chaos, no."