Security at beach hotels in the Tunisian resort of Sousse was criticised in a report produced for the British Government months before 38 people were killed in a terrorist attack there, including three Irish people an inquest has heard.
The January 2015 "recce" of hotels included the five-star Riu Imperial Marhaba where extremist Seifeddine Rezgui massacred tourists - including three Irish citizens and 30 British holiday-makers - the following June.
The inquests into the deaths of the British victims heard that the report questioned the security at the beach entrances to some 30 hotels in three Mediterranean resorts.
Rezgui killed around 10 of his victims on the beach and then entered the upmarket hotel from the entrance on the sand.
The resort had previously been targeted by a suicide bomber in October 2013, who killed only himself, the inquest heard.
Andrew Ritchie QC, who represents 20 victims' families, read extracts from the heavily redacted report to the hearing at the Royal Courts of Justice in London.
He said: "Given that the attack on the Riadh Palms Hotel in October 2013 was launched from the beach, particular attention was paid to the beach access points.
"It (the report) said 'Despite some good security infrastructure around the hotels and resorts there seems to be little in the way of effective security to prevent or respond to an attack (from the beach)'."
Mr Ritchie told the inquest the Government was aware that Islamic State-linked extremists had warned the terror group would target tourists in a video posted on YouTube in December 2014.
The inquests have previously heard that official guidance for tourists to Tunisia said there was a "high risk of terrorism" at the time of the Sousse attack.
This had not been updated to the highest level of advising against all travel despite a previous terror attack on the Bardo Museum in Tunis in March 2015 that killed 24 people, including 20 tourists.
The January report on the hotel security was carried out by an unnamed man who was in Mumbai in India at the time of the terrorist attack there in 2008, the inquest heard.
A counter-terrorism assessment for the FCO days after June's bloodshed in Tunisia also questioned the security at the beach resorts.
The review by the Tunisian Security Assessment Team (TSAT) found "facilities security at the hotels to be generally of a low standard" although "some hotels had better security".
Jane Marriott, a director of the Foreign Office's Middle East North Africa Directorate at the time of the attacks on the Bardo Museum and in Sousse, told the hearing that because, prior to the 2010 revolution, Tunisia had been a dictatorship, there was "little public desire for a more intrusive police presence".
She added: "This made it difficult for the authorities to be proactive with security."
A Briton who survived the attack had been assured it was "100PC safe" to go to Sousse by a travel agent when he booked, weeks after an earlier deadly attack on tourists in the country's capital, Mr Ritchie told the inquest.
Paul Thomson booked a stay in the Mediterranean resort after being told the Bardo attack in Tunis was a "one-off", the lawyer said.
He made the claim while cross-examining Ms Marriott on the travel advice for tourists in Tunisia at the time.
He asked about a "partnership agreement" between the Government and travel firms which required the companies to guide customers to official travel advice on the FCO website, including a section called Know Before You Go.
He said Mr Thompson had gone to a TUI shop in his home town of Ilkeston, Derbyshire, in May 2015 with his daughter.
She had read about the attack on the Bardo Museum in Tunis and asked staff in the shop "Is it safe?", Mr Ritchie said.
He went on: "(They were told) 'It's 100pc safe, this is a one-off'.
"Would you be comfortable with that as fulfilling the agreement?"
Ms Marriott, a former UK ambassador to Yemen, replied: "We would expect this (travel) information to be flagged up."
War On Terror
Lahouaiej Bouhlel was a 31-year-old French-Tunisian delivery driver, known to police, who is reported to have driven the 19-tonne white Renault lorry into the crowds gathered for Bastille Day celebrations. His identity as the driver had not been formally confirmed by the French police last night.