A BBC investigation has identified the man accused of organising the terror attack on a beach that killed 38 people in Tunisia.
Chamseddine al-Sandi is described as the "mastermind" behind the attack in documents obtained by Panorama.
He is named in confessions from suspects who were arrested in connection with the shootings.
Seifeddine Rezgui opened fire on the beach and in the Imperial Hotel near Sousse in June 2015.
Rezgui was killed at the scene, but the documents obtained by Panorama say that he was recruited and directed by al-Sandi.
The confessions say al-Sandi ran a militant cell responsible for both the Sousse shootings and the attack three months earlier at the Bardo National Museum in which 22 people died. Both attacks were claimed by the so-called Islamic State.
The documents show how closely Rezgui worked with the Bardo gang - describing how he met with them in cafes and mosques in Tunis and how he trained alongside one of the Bardo gunmen in an IS camp in Libya.
According to the confessions, al-Sandi recruited the attackers, paid for them to go to Libya for training and gave them their orders.
Al-Sandi is now believed to be on the run in Libya. The Tunisian authorities have issued warrants for his arrest in connection with both the Bardo and Sousse attacks, but the documents obtained by Panorama reveal the extent of his alleged involvement for the first time.
Of the 38 people who were killed in Sousse in June 2015, 30 were British, three were from Ireland, two were German, one was from Russia, one was Belgian and one was from Portugal.
The inquests into the deaths of the British tourists starts next week. But the lawyer representing many of the families told Panorama that he was unaware of al-Sandi’s involvement and had not seen his picture before.
"I have not seen that," said Demetrius Danas. "If you are right, and the families see that, they will be shocked to see the face of the man who caused them so much sadness."
Some of the families who were caught up in the Sousse attack have told Panorama that they were assured by tour operator Thomson that it was safe to travel to Tunisia.
Nicki Duffield said she rang Thomson repeatedly to check on the security situation after hearing about the Bardo museum attack.
"I was just constantly asking: ’Are we going to be safe, can you guarantee we are going to be safe?’" she said. "We were definitely told that there would be increased security."
Alison Caine also called Thomson because she was worried about going to Tunisia.
She said: "We called them after Bardo to make sure that it was still safe to travel and they reassured us it was and security had been stepped up. But I just wanted to make sure again the following month so we called them again just to double-check."
Ms Caine said she felt reassured by Thomson: "Everything was fine, it was safe to travel. They were not doing any refunds or transfers."
The families say they were told by the tour operator that if they cancelled they wouldn’t get their money back.
TUI, the travel company that owns Thomson, said it wants to understand the specific circumstances that led to the killings.
"We are cooperating fully with the Coroner and will continue to do so, in order to help ensure that the tragic deaths of those killed can be thoroughly investigated, the relevant facts determined and any lessons learned."
The company said it would be inappropriate to comment further before the inquests but it doesn’t accept the accuracy of all the statements that have been made.