Who exactly he had been calling before he began his spree is not yet known. But over the next 47 minutes Rezgui, a 23-year-old student, murdered 38 people, all of them foreign holidaymakers and most of them British: he also shot a Tunisian woman, and then immediately apologised to her. Pursued by hotel employees, all of them Tunisians showing extraordinary bravery, he ran to the sea and threw his phone into the waves. Soon afterwards, he was shot dead.
Read more: Cameron: 'These attacks can happen anywhere' Have US tactics only helped to make Islamists more powerful? These are the heroes who helped the Tunisia attack victims
The Samsung was fished out of the water by the police at just after 6am the following morning. It remains unclear just how much data has been retrieved by investigators and how much has been lost. But what is clear is that Rezgui had managed, with remarkable success, to conceal his links with Islamist terrorism from the public gaze for a very long time while planning his lethal mission.
Friends say he had travelled to Libya for military training. Tunisia’s Interior Secretary, Rafik Chelli, said that Rezgui had visited the neighbouring country in January, travelling with fellow jihadists who afterwards carried out the attack that targeted tourists at the Bardo Museum in Tunis, leaving 22 dead.
In pictures: Tunisia hotel attack
The friends say that Rezgui visited Libya again in March, during the academic spring vacation, when he could easily disappear from college at Issat (L’Institut Superior des Sciences et de Technologie) in Kairouan, where he had been taking a course in electronic network management.
He returned to his Master’s degree course after finishing what was almost certainly his final combat training across the border, and sat his end-of-term exams. He passed with average mark of 11.76 out of 20 and picked up his certificate on 29th May, as the college was closing for the summer.
At the same time, Rezgui was shutting down his rental at the house he shared with six other young men in the city’s Sidi Belgacem district, next to the Mosque of the Seven Virgins; a low-key place of worship used by locals in the impoverished area. All the tenants simply disappeared one night. The neighbours they left behind had, however, been given a rare glimpse of the almost schizophrenic existence led by Rezgui for at least the past three years.
To most of his classmates and staff at Issat, and to a wide array of acquaintances, Rezgui had appeared to be a well-adjusted, if unremarkable, modern young man, not particularly interested in religion or politics - clean shaven, with a tendresse for techno-music, breakdancing and Real Madrid.
But at Sidi Belgacem he and his companions led secretive lives, refusing to socialise with other residents and staying indoors for long hours. A group of bearded Salafists came at times to hold prayers at the mosque, which had been left unsupervised, its elderly imam absent for months. Then they would all disappear together behind the peeling white front door of Rezgui’s house.
These were the men, fellow believers in establishing a caliphate with a sword, of Rezgui’s real world. Some had trained with him in Libya. Three had travelled to Syria - where Tunisia provides the largest contingent of foreign jihadists - and two of them eventually died there.
Tunisian authorities released photographs of two men being sought in connection with the attack, identified as “Bin Abdallah and Rafkhe Talari”. Whether they were among the visitors to, or residents of, his house is not immediately clear.
So what shaped the life of Abu Yahya al-Qayrawan, the nom-de-guerre given by Isis to its latest poster boy, whose killings have caused so much grief to Britain and also threaten to cripple Tunisia’s tourist industry?
Rafkhe Talari (left) and Bin Abdallah (right) are both wanted by Tunisian police Rezgui was born on 29th August 1992 in Gaafour, an austere, conservative town 50 miles south-west of the capital Tunis, which fell on hard times when nearby zinc and lead mines closed a year after his birth. He was known for his hot temper as a young schoolboy and his level of aggression rose after a brother, aged 14, was killed in a lightning strike,
His father, Hakim Rezgui, who was arrested but then released by police after the Sousse murders, is adamant. “My son was a good boy, he did not have any problems with anyone, over religion, or anything else. It all went wrong after he left home; he got new friends, evil people who twisted his mind, planted evil thoughts,” he told the streams of international media arriving at his door.
The circle of Rezgui’s friends changed in Kairouan along with his changing view of the world, as he embraced Islamists who expressed their views in harsh, uncompromising rhetoric. Two friends who kept in touch with him described the transformation. Neither of the men wanted their full names disclosed, fearing the attention both of Islamist extremists and of the security forces.
They said Rezgui was elated, as were so many young people, by the fall of Tunisia’s strongman, Zine el-Abedine Ben-Ali, four years ago, in what was to be the opening chapter of the Arab Spring. “But then he began to get angry, bitter, more religious,” said Taha, 25, who lives in Kairouan.
“He began to talk about how the end of the dictator should have been followed by the establishment of a more pure society upholding Islam, but he saw nothing improving, things just getting worse.
“By the end of the year we saw him openly hanging around with the Salafists, people who felt the same way as him. But there was another side to him: he did not grow a beard, he still talked about sports, mixed with people who drank, talked with girls. Many of us thought he would come back to normal life.”
But Yassin, 26, who had himself recently flirted with Islamism, maintained that Rezgui had already crossed the line. “He suddenly began to do this ‘cool dude’ thing, overdoing it really. All these blogs about techno, then the dancing. He would be with people who drank. But it was too much, it didn’t make sense, especially because privately he would sometimes talk about his real feelings. I think he trusted me because I was looking into myself, into religion myself at the time.”
Taha nodded in agreement. “He was someone in disguise, he put a mask on to keep himself hidden,” he said.
Rezgui, according to the two men, was appalled by the savage retribution of Basher al-Assad’s regime when the Syrian uprising began, railing at the West for betraying Syrians while praising the al-Qaeda affiliated Jabhat al-Nusra, whose fighters joined the Syrian opposition, and then Isis as the right answers for Islam.
Rezgui did not travel to Syria. But, according to Tahan and Yassin, he went to Libya during the revolution against Muammar Gaddafi, accompanying men who were smuggling arms to the rebels, and may have taken part in some action. “It was for everyone in Libya easy to fire a gun at the time and no one could be blamed for fighting Gaddafi,” said Yassin. “I think the real thing, the training, came in later visits. First he was trained by Ansar al-Sharia (an al-Qaeda affiliate) and then by Daesh (Isis). In the meantime he carried on with his act.”
Read more: Tourism was the real target during massacre in Sousse British tourists' relatives plead for information on the missing
A Facebook page believed to belong, mostly peppered with postings about music and football, occasionally also featured postings in support of Isis. But otherwise Rezgui’s act was a very good one. The Tunisian authorities admit that he was not on any security watch list and was free to plan multiple murders. After eventually shooting him dead, they established his identity only through a student card in a pocket of his blood-soaked clothing.
Police confessed to staff at Issat that they knew next to nothing about the man who had just committed a major act of terrorism. Karem Belgharagh, head of administration at the college, was called by the Ministry of Information an hour and half after the killings and told that a student was the killer.
“Rezgui had never remotely showed any interest in religion or politics to myself or anyone else on the staff,” recalled Mr Belgharagh. “I was still in a state of shock when the police arrived 10 minutes later - but they too were in shock. They said they had never suspected him of anything.”