Shoppers walk past a Gap Inc. clothing store in London, U.K., on Thursday, May 25, 2017.Simon Dawson | Bloomberg | Getty ImagesBritain’s sluggish economy looks to have dodged recession in the run-up to its deadline for leaving the European Union this month, 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. However, the stronger performance largely reflected data 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, while growth in July was revised up to 0.4%, the Office for National Statistics said. Sterling edged up against the U.S. dollar following the stronger-than-expected data. “The economy has regained some momentum but the underlying trend is towards softer growth. The headwinds from a major global slowdown and uncertainty at home point to weaker growth ahead,” said Ian Stewart, chief economist at accountants Deloitte. Britain’s economy shrank in the second quarter of the year, 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. 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.As well as Brexit, manufacturers across Europe have been hit by a rise in trade tensions between the United States and China which has weighed on growth globally.The new managing director of the International Monetary Fund, Kristalina Georgieva, warned earlier this week that the world economy was suffering a “synchronised slowdown.”The Bank of England predicted last month that Britain’s economy would manage growth of 0.2% in the third quarter, bolstered in part by higher public spending. But September 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 good anecdotal evidence of the effect of Brexit preparations on the economy in August, when the annual rate of growth slowed to 1.1% from 1.3%, matching a seven-year low set in June. “Growth increased in the last three months, despite a weak performance across manufacturing, with TV and film production helping to boost the services sector,” ONS statistician Rob Kent-Smith said. Soft global demand was hurting demand for manufactured exports, the ONS added, and growth in the dominant services industry slowed to zero in the month of August alone.August trade data also released on Thursday showed Britain’s goods trade deficit widened slightly to 9.8 billion pounds ($12.0 billion) from 9.6 billion pounds in July, versus Reuters poll forecasts of 10.0 billion pounds. Britain’s total trade deficit for goods and services narrowed slightly to 1.5 billion pounds from 1.7 billion.