A coroner has ruled that 30 British tourists massacred by an Isis gunman in Tunisia were not the victims of neglect by hotel operators and travel companies, despite a "shambolic" security response.

They were among 38 victims of the shooting by Seifeddine Rezgui, a former break dancer turned extremist, in Sousse on 26 June 2015.

Judge Nicholas Loraine-Smith found his victims had been “unlawfully killed” at the five-star Hotel Imperial Marhaba at the conclusion of inquests held at the Royal Courts of Justice.

Tunisia terror attack inquest: Police 'stalled arrival' at Sousse massacre

Lawyers representing their families argued that holiday firm TUI and hotel operators did not take the terror threat to Tunisia seriously following a previous attack on the Bardo Museum, and wrongly assured tourists the destination was safe.

Andrew Ritchie QC, counsel to victims’ relatives, said there had been “gross neglect” but Howard Stevens QC, representing TUI, dismissed the call and said “matters could have been worse” during the terror attack.

The coroner could not “simply dismiss the security presence”, he argued, claiming that if there were additional CCTV cameras or guards at the beach it “cannot be said that any of these measures would probably have made a difference”.

Judge Loraine-Smith said there were a lot of “what ifs” around the case and better hotel security may simply have meant more people died on the beach, rather than inside the building.

As the packed courtroom watched in silence, he said the only factor that may have made a material difference was if the hotel had armed guards, which was "not a realistic option" given Tunisia's gun laws.

The coroner condemned the police response as at best “shambolic” and at worst “cowardly” but said case law limited his ability to make a neglect finding.

In pictures: Tunisia hotel attack Show all 32 1 /32 In pictures: Tunisia hotel attack In pictures: Tunisia hotel attack Tunisia The coffin of Denis Thwaites is carried from an RAF C-17, which repatriated the bodies of eight British nationals killed in the Tunisia terror attack, at RAF Brize Norton near Oxford in Britain In pictures: Tunisia hotel attack Tunisia The coffin of John Stollery is carried from an RAF C-17, which repatriated the bodies of eight British nationals killed in the Tunisia terror attack, at RAF Brize Norton near Oxford in Britain In pictures: Tunisia hotel attack Tunisia The coffin of Elaine Thwaites, one of the victims of the terrorist attack, is taken from the RAF C-17 aircraft at RAF Brize Norton in Tunisia In pictures: Tunisia hotel attack Tunisia Hearses carrying the victim's of last Friday's terrorist attack arrive at Tunis Airport Getty Images In pictures: Tunisia hotel attack Tunisia An RAF C17 transport aircraft arrives at RAF Brize Norton Airport in Oxfordshire carrying the bodies of 8 British people killed in the Tunisia gun attack Getty Images In pictures: Tunisia hotel attack Tunisia Ambulances carrying the victim's of the terrorist attack arrive at Tunis Airport Getty Images In pictures: Tunisia hotel attack Tunisia Armed police continue to patrol Marhaba beach in Sousse Getty Images In pictures: Tunisia hotel attack Tunisia National guard members patrol at the beach near the Imperiale Marhaba hotel, which was attacked by a gunman in Sousse In pictures: Tunisia hotel attack Tunisia Military personnel attending to injured British nationals on board an RAF C-17 aircraft en route back to the United Kingdom, in Tunisia In pictures: Tunisia hotel attack Tunisia Military personnel attending to injured British nationals on board an RAF C-17 aircraft en route back to the United Kingdom, in Tunisia In pictures: Tunisia hotel attack Tunisia Holidaymakers lay flowers on Marhaba beach Getty Images In pictures: Tunisia hotel attack Tunisia Tourists pay tribute to the victims of the Sousse attack at a makeshift memorial on the beach at the Imperial Marhaba resort Reuters In pictures: Tunisia hotel attack Tunisia The Home Secretary Theresa May pays her respects with her counterparts, France’s Bernard Cazeneuve, left, Germany’s Thomas de Maiziere, second left, and Tunisia’s Najem Gharsalli, in Sousse Reuters In pictures: Tunisia hotel attack Tunisia Two tourists pay respects to victims of IS attack on beach in Sousse, Tunisia Kenzo Tribouillard/AFP/Getty In pictures: Tunisia hotel attack Tunisia Many people remain unaccounted for and many of their relatives have taken to social media in the hope of obtaining information about those who are still missing (Getty) Getty In pictures: Tunisia hotel attack Tunisia A boy holds a Tunisian flag at the spot on the beach where the attack took place Reuters In pictures: Tunisia hotel attack Tunisia A man kisses a Tunisian flag at the site of a shooting attack on the beach in front of the Riu Imperial Marhaba Hotel in Port el Kantaoui, on the outskirts of Sousse In pictures: Tunisia hotel attack Tunisia The front of the Marhaba hotel Getty In pictures: Tunisia hotel attack Tunisia Tunisian Ennahdha party member and former minister Houcine Jazir speaks with Belgium survivor couple Corman (R) and Claude Pesser after a mass shooting in the resort town of Sousse In pictures: Tunisia hotel attack Tunisia The bloodstained belongings of a tourist are seen on the sand in the resort town of Sousse AFP/Getty Images In pictures: Tunisia hotel attack Tunisia A broken glass window of the Imperiale Marhaba hotel is seen after a gunman opened fire at the beachside hotel in Sousse Reuters In pictures: Tunisia hotel attack Tunisia Blood stains cover the ground at the Imperial Marhaba Hotel in Sousse, Tunisia after mass shooting Fethi Belais/AFP/Getty In pictures: Tunisia hotel attack Tunisia Policemen patrolling the beach in front of the Riu Imperial Marhaba Hotel in Sousse where tributes have been laid to the dead AFP/Getty In pictures: Tunisia hotel attack Tunisia People stand in silence next to flowers during a gathering at the scene of the attack in Sousse, Tunisia Getty In pictures: Tunisia hotel attack Tunisia Messages and flowers are left on Marhaba beach where 38 people were killed in a terrorist attack in Souuse Getty Images In pictures: Tunisia hotel attack Tunisia Police officers control the crowd while surrounding a man suspected to be involved in opening fire on a beachside hotel in Sousse, Tunisia In pictures: Tunisia hotel attack Tunisia Medics help an injured man in Sousse In pictures: Tunisia hotel attack Tunisia A body lies on a street in Sousse In pictures: Tunisia hotel attack Tunisia Members of the Tunisian security forces in an armoured vehicle patrol a street in Sousse In pictures: Tunisia hotel attack Tunisia The beach where the massacre took place Lionel Tunisiano/Twitter In pictures: Tunisia hotel attack Tunisia A general view of the deserted pool and deck chairs at the Imperial Marhaba Hotel EPA In pictures: Tunisia hotel attack Tunisia A woman looks toward a glass door shattered by a bullet at Imperial Marhaba Hotel EPA

“The simple but tragic truth is a gunman armed with arms and grenades went into the hotel intent on killing as many tourists as he could,” he added.

The Government’s advice at the time urged tourists to be vigilant in Tunisia and listed recent terror attacks, warning of a risk but stopping short of advising them against visiting.

British citizens are now advised against “all but essential travel” in the entire country, with all travel prohibited in volatile border areas.

The Sousse attack came three months after 24 people were killed in a terror attack at Bardo National Museum in Tunis, which was later linked to the same cell of Isis militants.

Rezgui, who had undergone militant training in Libya, hit his AK-47 in a beach umbrella before opening fire on the beach at 11.50am, massacring tourists for at least 20 minutes before being chased away by Tunisian hotel employees.

He was shot dead minutes later by police, who arrived after local security forces "deliberately and unjustifiably slowed down" responding to the attack according to a report by a Tunisian judge.

A memorial to the 38 people killed in the Sousse attack stands on the beach on the first anniversary of the attack (Getty)

The hotel had just a handful of unarmed guards, the inquests found, while one group of police returned to get more weapons before heading to the beach, and another fainted on arrival from fear.

The coroner found police could have been effective but said a direct link between the security response and deaths could not be proved.

Some of the families of those caught in the massacre said they raised concerns with TUI after the massacre but were assured Tunisia was “100% safe”.

Paul Thompson said he and his wife were “pushed” towards choosing Tunisia and told the atrocity was a “one-off”, adding that another travel agent likened it to avoiding Skegness if there was an attack in London.

A Thomson travel agent told the inquest she did not give a safety guarantee to the couple, and that she would not say somewhere is completely safe.