The coroner at the inquest into the deaths of 30 British tourists at the hands of an Islamic extremist in Tunisia in 2015 has cleared holiday firm TUI of “neglect.”

Despite grievances from survivors and victim’s families, Judge Nicholas Loraine-Smith found that neither the owners nor the staff at the five-star Riu Imperial Marhaba Hotel could have prevented the tragedy. He did, however, conclude that “all 30 [victims] were unlawfully killed.”

TUI is the owner of travel agency Thomson, which all 30 of the British victims had used to book their June holiday.

The seven-week inquest explored the events leading up to and following the mass shooting at the Sousse beach resort, when jihadist Seifeddine Rezgui opened fire on sunbathers, killing 38. The 30 minute rampage came to an end when Rezgui was killed in a shoot-out with Tunisian police.

The gunman was reportedly high on drugs when he picked up a Kalashnikov assault rifle he had concealed in a beach umbrella. He was described as having a smile on his face during the massacre.

“His teeth were white, not yellow. He seemed to be smiling,” survivor Stephen Leake said of Rezgui, who at one point stood 20ft away from him.

Postmortem toxicological tests showed that the jihadist had consumed a drug – believed to be cocaine – of which some effects can include “aggression and extreme anger that leads to murders being committed.”

Families of some of the victims are now preparing legal action against TUI.

“It is now crucial that the whole travel industry learns from what happened in Sousse to reduce the risk of similar catastrophic incidents in the future,” their legal representative Kylie Hutchison, from law firm Irwin Mitchell, said outside the Royal Courts of Justice.

“On behalf of our clients who lost members of their family and those who suffered injuries in this terrible incident, we will now be preparing to commence civil proceedings against TUI.”

its disgraceful that the families of the victims of the Tunisia shooting get to sue the tour operator TUI. not their fault ISIS attacked

She argued that in the years leading up to the Sousse massacre, terrorism had escalated in the region, but the operator had done little to improve security measures.

Loraine-Smith too found that TUI had not informed customers where to get advice in the wake of a prior attack at the Bardo National Museum in Tunis, which had killed 22 people. Customers said they had been reassured by TUI it was safe to travel to the country despite the attack, but this was disputed by the company.

The judge thought there were too many “what ifs” to rule against TUI on the matter of neglect.

“We are so very sorry for the pain and loss those affected have suffered,” TUI UK managing director Nick Longman said after the inquest finished.

“On that day the world changed. As an industry we have adapted and we will need to continue to do so. This terrorist incident has left its mark on all of us and its impact will always be remembered.”