LONDON (Reuters) - Britain’s economy looks to have dodged recession in the run-up to its deadline for leaving the European Union this month but the pace of growth has sagged as exporters felt the impact of the slowing world economy, official data showed on Thursday.

Gross domestic product in the three months to August was 0.3% higher than in the previous three months, beating all forecasts in a Reuters poll of economists and accelerating from an upwardly revised 0.1% in the three months to July.

But the stronger performance largely reflected revisions to earlier months and the most recent figures were weak.

Output in August alone dropped by 0.1% on the month versus economists’ average forecast for it to hold steady, the Office for National Statistics said.

Sterling edged up against the U.S. dollar GBP= following the stronger-than-expected data.

The world’s fifth-biggest economy shrank in the second quarter, driven by a sharp decline in April when businesses found themselves holding unnecessary stockpiles of raw materials after Brexit was delayed from the original date of March 29.

The Bank of England predicted last month that Britain’s economy would grow by 0.2% in the third quarter, bolstered in part by higher public spending.

Slideshow ( 4 images )

BoE Governor Mark Carney said the underlying rate of growth was even weaker and Thursday’s data “is consistent with that picture”.

Investec economist George Brown said Britain was set to avoid a recession. “But at the same time it is apparent that growth is fragile amid the uncertainty surrounding Brexit and the global economic backdrop,” he said.

The annual rate of GDP growth slowed to 1.1% from 1.3%, matching a seven-year low set in June.

RECESSION RISK DIMINISHES

Prime Minister Boris Johnson has promised to take Britain out of the EU by Oct. 31, without a transition period if necessary - despite parliament telling him to delay Brexit again if he cannot negotiate a fresh deal. Businesses say a no-deal Brexit risks causing major disruption to imports.

Two consecutive quarters of contraction would mean Britain’s economy met a commonly used definition of recession, but the ONS said the economy would need to shrink by an almost unprecedented 1.5% in September alone for this to happen.

Slideshow ( 4 images )

As well as Brexit, manufacturers across Europe have been hit by a rise in trade tensions between the United States and China.

The new managing director of the International Monetary Fund, Kristalina Georgieva, warned earlier this week that the world economy was suffering a “synchronised slowdown”.

So far the Bank of England has not followed the U.S. Federal Reserve and European Central Bank and cut interest rates but last month one BoE policymaker, Michael Saunders, said this might prove necessary.

September’s IHS Markit purchasing managers’ index data released last week for the private sector pointed to a 0.1% contraction in the third quarter, with businesses reporting that foreign customers were staying away before Brexit.

The ONS said it had not received any substantive anecdotal evidence of the effect of Brexit preparations on the economy in August.

Industrial output dropped by 1.8%, the biggest annual fall in six years. Soft global demand was hurting demand for manufactured exports, the ONS said, and despite bright spots such as film and television production, growth in the dominant services industry slowed to zero in the month of August alone.

Reflecting slower export growth, August trade data showed Britain’s goods trade deficit widened slightly to 9.8 billion pounds ($12.0 billion) from 9.6 billion pounds in July, broadly as expected by economists.

The total trade deficit for goods and services narrowed slightly to 1.5 billion pounds from 1.7 billion.