Media playback is unsupported on your device Media caption Survivor Allen Pembroke went back to the beach

Relatives of the British victims of the Tunisia terror attack will sue tour operator TUI, a lawyer representing many of the families has said.

The announcement was made after a coroner ruled the victims were "unlawfully killed" by a gunman at a hotel in Sousse in June 2015.

Judge Nicholas Loraine-Smith rejected a finding of neglect against the tour firms and the hotel.

The 38 dead included 30 Britons. TUI has denied gross failure.

Judge Loraine-Smith ruled the Tunisian police response was "at best shambolic and at worst cowardly".

On 26 June 2015, a gunman opened fire on holidaymakers staying in the popular resort of Port El Kantaoui, just north of Sousse in Tunisia, killing 30 British tourists and eight others.

So-called Islamic State (IS) said it was behind the attack by Tunisian student Seifeddine Rezgui.

"The simple but tragic truth in this case is that a gunman armed with a gun and grenades went to that hotel intending to kill as many tourists as he could," the coroner said.

What exactly happened on the day?

How Tunisia's security changed

Heavy security and whitewashed walls as Sousse tries to move on

But Kylie Hutchison, a solicitor for 22 of the families, said it was crucial that the travel industry learned from what happened in Sousse.

She added: "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."

TUI maintained it was "wholly erroneous" to claim it had been neglectful and there was insufficient evidence of any gross failure.

Media playback is unsupported on your device Media caption Cheryl Stollery's husband John, a former paratrooper, was shot dead next to her as the couple tried to flee from the gunman

Officers near the scene ran in the opposite direction to get more guns while the Islamist gunman sprayed bullets at sunbathers on the beach and threw grenades, the inquest heard.

He then stormed into the hotel to kill more victims.

It was only after an hour-long killing spree that Seifeddine Rezgui was shot dead by police.

Tunisia attack: 'He sacrificed himself'

One survivor's recurring nightmare

Who were the victims?

There were emotional scenes in the packed courtroom of London's Royal Courts of Justice as the coroner described how each of the victims came to their death, in alphabetical order.

The dead were aged between 19 and 80. Among them were three generations from one family - a young man, his uncle and his grandfather.

Media playback is unsupported on your device Media caption Tunisian hotel worker Ibrahim Elghoul says he tried to stop the gunman going to more hotels

Families had wanted the coroner to consider whether neglect by holiday firm TUI or the hotel owners was a factor in their relatives' deaths.

But he told them he could not because the law regarding neglect did not cover tourists who voluntarily agreed to go on holiday.

He added that he had not found a direct and causal link between the response of armed officers in the area and the deaths.

He 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.

The only factor that might have made a difference was if the hotel guards had been armed, he added.

"Having reviewed the legal advice on gun law in Tunisia, it's clear this was not a realistic option," he said.

Media playback is unsupported on your device Media caption Olivia Leathley: "Even if one life could have been saved, it's one life"

In summing up at the end of a six-week hearing, the judge said holidaymakers had been "reassured" about safety before booking.

One man said his wife had raised the March 2015 attack at the Bardo museum in the capital Tunis with a travel agent, who told her it had been a "one-off" and the place was "100% safe".

A Thomson travel agent said she would not say somewhere was completely safe, the inquest heard.

'Business as usual'

Image copyright EPA Image caption Solicitor Kylie Hutchison reads a statement on behalf of the relatives

By Richard Galpin, BBC News correspondent

The families of those killed are bound to be disappointed by the coroner's ruling that he could not include neglect in his conclusions today.

If he had, it would have potentially bolstered their cases when they launch personal injury and fatal accident claims against the holiday company TUI sometime over the next year.

All thirty British tourists killed in the attack had booked their holidays through TUI's subsidiary, Thomson.

The inquest had heard earlier that TUI did not carry out any security checks at the hotel where they were staying, until after the attack.

TUI denies the allegations of neglect saying security at hotels was not its responsibility.

The families may latch on to what the coroner then went on to say in his summary of the evidence.

He chose to highlight a document which he described as a crib sheet, circulated by TUI to its staff.

It told them how to respond to questions from customers about safety in Tunisia in the aftermath of an earlier attack in 2015 on foreign tourists in the capital Tunis in which more than twenty people were killed.

They were to tell customers that the overall level of the Foreign Office travel advice had not changed.

If asked what is the atmosphere like in beach resorts, the coroner said the TUI crib sheet said the answer was "It's business as usual, customers continue to enjoy their holidays."

"It did not mention terrorism or a risk of terrorism."

Although the Foreign Office had not advised against people travelling to Tunisia, it had warned on its website of a "high threat from terrorism, saying "attacks could be indiscriminate including in places visited by foreigners."

After the ruling, 42-year-old Scott Chalkley's family said: "What is perhaps the saddest is that Scott was taken when he had found true happiness with his partner Sue.

"We have been robbed of a future that held promise and laughter of a wonderful man so needlessly and heartlessly snatched from our lives."

Media playback is unsupported on your device Media caption Ceri Lock, a friends of victim Trudy Jones, criticises Tunisian police response

Image caption CCTV footage of the Tunisia beach attack gunman roaming the hotel complex

The attack was the deadliest on Britons since the 7 July 2005 London bombings.

Survivor Allen Pembroke told the BBC how he found people lying in pools of blood among sun loungers close to the water's edge.

He gave first aid to British holidaymaker Cheryl Mellor, who was still alive after being shot in the leg and arm, but drifting in and out of consciousness.

He said he was alone on the beach for 20 minutes checking on the dead and injured, with no help from anyone else.

"I saw no military or medical staff and it's only in recent reports that I found out that the police waited, they fainted, they hid.

"That's unforgivable, they need to be accountable for that," he said.

Image caption Cheryl Mellor lost a hand in the attack

The Tunisian ambassador to the UK, Nabil Ammar, said his country had been unprepared for such an attack and it was unfair to blame police.

Our nation is safe - Tunisia ambassador

Since the attack, he said security in the country and in hotels had improved, and Tunisia should be shown the same solidarity as other countries which had experienced similar attacks.

Following the inquest, Nick Longman, managing director of travel operator TUI, said: "We have now heard the coroner's findings and his comments regarding the provision of security and visibility of travel advice.

"These are complex matters and we have already taken steps to raise awareness of the FCO's Travel Aware campaign. As an industry we have adapted and we will need to continue to do so."

A spokesperson for the association of British travel agents (ABTA) said they would be reviewing the Coroner's report "to see if there are any learnings for the industry".

The Foreign Office says further attacks are highly likely in Tunisia, including against foreigners, and advises against all but essential travel.

A Foreign Office spokesman said: "We welcome the thorough work by the coroner and his team for more than a year on this important investigation, resulting in today's conclusions.

"Our deepest sympathy remains with all those people caught up in this horrific attack and we hope that the inquest process has been of some help to the families."