The "unjustifiable" delay by Tunisian law enforcement units to intervene in the Sousse attack was due to "simple cowardice", an inquest has heard.
The inquest into the deaths of 30 Britons at the Royal Courts of Justice heard that lives could have been saved.
Some units took about 30 minutes longer than they should have to reach the scene, according to the report from a Tunisian inquiry read out in court.
It also said the gunman had taken a drug that causes "extreme anger".
Islamist Seifeddine Rezgui killed 38 people at the five-star Riu Imperial Marhaba, near Sousse, on 26 June 2015, before he was shot dead by police.
The attack was the deadliest on Britons since the 7 July 2005 London bombings.
A summary of an investigation by Tunisian Judge Akremi was read out in court, which said that a post-mortem examination showed that Rezgui had been shot 20 times.
It added that toxicological tests revealed the presence of a drug, the main effects of which include "the feeling of exhaustion, aggression and extreme anger that leads to murders being committed".
The summary said another effect of such drugs is that they "enhance physical and mental performance".
'Deliberate and unjustifiable'
The judge's report also included an assessment by the secretary of state to the minister of the interior responsible for security matters.
He had examined cameras which "showed that the tourist security team vehicle patrol and bike patrol deliberately slowed down and did not intervene to stop the terrorist attack at that time".
The patrol committed "what is considered a serious mistake, and that its delay was deliberate and unjustifiable".
He referred to a unit that went in search of more body armour and weapons instead of going straight to the scene of the incident, a move he said was "unjustifiable" as the vehicle was equipped with enough weapons to stop the attack.
The assessment said that what this team did "amounts to an offence for which it must take the blame".
The inquest heard from the head of the operations room for the Northern Sousse National Security as part of the Akremi report summary.
That person, whose role was to co-ordinate the various security authorities, said the refusal to intervene to stop the attack was "due to simple cowardice, when they could have prevented the loss of life".
'Lack of clarity'
The report summary referred to the divisional head of the Tourist Security Police in Sousse, saying: "He stated that he panicked and was afraid because there was an armed attack on the tourist area for which he was responsible."
It was the divisional head, referred to as AE, who made the decision to stop off for more weapons instead of rushing to the incident, according to the report summary.
Judge Akremi observed that AE spent more than eight minutes inside the police station.
"AE could have intervened and stopped the terrorist attack in no more than three minutes," he said.
"In fact it took AE more than 30 minutes to arrive at the scene."
It added that it took others about 35 minutes to reach the scene, when it should have taken them no more than five minutes.
A delay for one unit was "due to lack of clarity of information", while another responder "deliberated over whether the intervention would be effective".
The inquest heard that quad bike units were delayed because they were in "very poor condition" and "incapable of driving over sand".
The delay of those on horseback was said to be the result of "caution" they had shown in getting there after hearing the terrorist was armed with a Kalashnikov.
The inquest was adjourned to 23 February.