LONDON, Sept 11 (Reuters) - Britain's economy grew by a much stronger than expected 0.4% in July, extending the strong performance seen in ‌the first half of the year despite headwinds from the ‌U.S.-Iran war, figures from the Office for National Statistics showed on Friday.

Economists polled by Reuters had ​a median forecasts for the level gross domestic product in July to be unchanged from June after growth of 0.4% in June.

Compared with a year earlier, output in July was 1.6% higher, the fastest annual rate since February 2025 ‌and above economists' 1.2% ⁠forecast.

Growth in the three months to July held at the 0.4% recorded in the three months to June, compared with ⁠economists' median forecast for a slowdown to 0.3%.

"Ongoing strength in the services sector was only partially offset by falls in both production and construction," ONS Director ​of Economic ​Statistics Liz McKeown said, adding that ​artificial intelligence seemed to be ‌lifting software development.

In the first half of 2026, Britain's economy expanded by 1%, the fastest growth across the Group of Seven large advanced economies – although some analysts believe this may in part reflect seasonal effects that have not been fully adjusted for.

In July, the Bank of England forecast the economy would ‌expand 1.1% over 2026 as a whole, ​and earlier this week Governor Andrew Bailey ​told a parliament committee that ​economic data since then had come in "a bit stronger" than ‌he had expected.

Britain, like other European ​economies, has taken ​less of an immediate hit to growth from the U.S.-Iran war than economists had feared at the outset.

But the conflict this week pushed ​oil prices above $105 a ‌barrel with knock-on impacts on government borrowing costs, and the BoE ​expects inflation to rise to around 3.2% later this year.

(Reporting by ​David Milliken; editing by William James)