Thomson and First Choice owner TUI warned today that the terrorist massacre in Tunisia will hit its earnings by up to £32million.

The attack in June claimed the lives of 38 holidaymakers including 30 UK nationals who were all TUI customers as were two other victims from Germany and one from Belgium.

Tourists were flown home from the North African country and the travel operator has cancelled holidays there, with the UK Foreign Office and other governments still advising against visits.

The cost of the flights home was 10m euros (£7m) while the impact of empty hotels in a region that normally accounts for nearlyu 500,000 TUI visitors a year is expected to be 25m to 30m euros (£18m to £21m).

Together with other costs, the total impact is seen at 35m to 45mi euros (£25m to £32m), a spokeswoman for the company said.

Tunisia has in the past represented 3% of the company’s annual tour operator programmes. TUI set out details of the impact in a trading update for the third quarter to the end of June.

Joint chief executives Friedrich Joussen and Peter Long said: “This quarter was marked by the tragic events in Tunisia at the end of June.

“Supporting our customers, their families and our colleagues through this sad time remains our highest priority.

“We are very proud of the commitment and dedication our colleagues have shown throughout this unprecedented situation.”

Mr Long described the attack as a “human tragedy that completely overshadowed our quarter”. He said it was “the most horrific event I and my company have ever had to deal with”.

TUI also said that bookings to Greece in late June and the first half of July were hit by economic uncertainty in the region, and Mr Long said he was also concerned the publicity surrounding the arrival of migrants on a number of Greek islands might put off potential visitors.

However, Mr Long said that overall there had been no impact, as after a slowdown in bookings, there had been a recovery.

He said that after the Tunisia attack, 18 additional flights were laid on to bring holidaymakers home, including 13 from the UK, four from Belgium and one from the Netherlands. Most of those with trips booked to Tunisia were re-booked on 26 extra flights to 13 destinations including the Balearic Islands, mainland Spain and Cyprus.

Mr Long added: “Our priority has been to support our customers, their families and colleagues impacted by this horrendous event.

“Both I and all my colleagues still remain in deep shock as a result of the tragic loss of life and injuries to our customers.”

Despite the tragedy, TUI delivered an 18% rise in underlying earnings for the quarter to 194m euros (£138m). Mr Long said summer trading remained “robust” while bookings for the winter were in line with expectations and there had been a good start for the summer 2016 period.

The figures from TUI come after rival Thomas Cook revealed a £25m hit to earnings from events in Tunisia and Greece.