When Nelson Mandela’s open coffin was lowered onto a cubic platform in the Union Buildings in Pretoria in 2013, four junior naval officers wearing white uniforms moved in to stand guard at each corner of the casket facing away from his body.
A quartet of military men would remain there, looking downwards, changing shift every few hours, as hundreds of thousands of mourners filed past for the late icon’s lying in state.
The fact the scene looked so similar nine years later at Westminster Hall, where guardsmen from three ceremonial units were positioned around the Queen’s coffin at her lying in state, reveals the workings of a small and secretive club of planners organising the funerals of global icons.
When South African officials organising the ceremonies which would follow the death of Nelson Mandela were handed confidential details from Operation London Bridge - the plan for what would happen after the monarch’s death - they liked the look of the "four guards" idea so much they decided to borrow it for what they called their "Mandela plan".
“That ceremonial aspect was learned from the UK." said Dr Cassius Lubisi, coordinator of Nelson Mandela's funeral and memorial events.
Dr Cassius Lubisi explains how the idea of 'four guards' during Nelson Mandela's lying in state was learnt from the UK
“There [had been] interaction between the South African National Defence Force and their counterparts in the UK about the idea of using sentries to guard the coffin when Madiba was lying in state.
“The South African side was aware that London was planning for a number of years for the Queen’s funeral” he said, disclosing for the first time the close cooperation between teams in the UK and South Africa preparing for the burial of their respected leaders.
“It became very important that the South African side interact in London to get some lessons.”
British officials also spoke to their Israeli counterparts who planned the 2016 funeral of Shimon Peres, the late Israeli leader.
The then Prince of Wales attended that ceremony on behalf of the UK alongside US president Barack Obama and former president Bill Clinton.
But after more than a decade of discussions between officials in Pretoria and London there were lessons to be learned on both sides.
British planners have sought out the experience of the South Africans who warned them to “brace for the influx” of foreign leaders who only decide they want to attend the funeral once they see how many of their peers are going.
101 heads of state and government travelled to Johannesburg for Mandela’s memorial service - alongside the celebrity entourages of Bono, Richard Branson and Naomi Campbell - but the hosts had only prepared for 70 to leaders to come.
Dr Cassius Lubisi said planners for the Queen's funeral must be prepared for more world leaders than they have invited
The strains on security and a mix-up during the accreditation process led to one memorable mistake when a man posing as the official sign language interpreter made it onto the stage where he gesticulated nonsense while standing next to world leaders. He later said he was suffering from a schizophrenic episode.
"Anything could have happened,” says Dr Lubisi, who recalls the horror among senior figures as it dawned on them that the man standing on stage shouldn’t have been there.
“The person was standing next to Barack Obama, Raul Castro and everyone. So, it's something that is, I think, a lesson that should be learned by anyone who organises these kinds of events.”
Dress rehearsals have taken place to prevent an equivalent of the bogus interpreter slipping through the cracks of what is not only the oldest plan in British policing (it’s been around in some form or another for decades) but the biggest - bigger, even, than the arrangements for the 2012 London Olympics.
Scotland Yard is leading the work to thwart any attempts to attack or exploit the event, but almost every police force in the country is involved, as well as multiple Whitehall departments and royal palaces.
10,000 officers will be on duty around key venues, not just along the ceremonial route, but at the locations outside central London from where some world leaders will be ferried towards Westminster Abbey.
Adding to the difficulty of keeping everyone safe is the broad range of protocols which the UK has with different security teams from different countries.
“Those colleagues working with the FCDO (Foreign, Commonwealth and Development Office), government and many other organisations are well versed and are engaging with individuals and world leaders and their own protection teams, whatever they may look like, from wherever they come from in the world”, said Metropolitan Police deputy assistant commissioner Stuart Cundy.
“First and foremost, our priority is to ensure that the state funeral is safe, and we do everything that we can to support it.”
The funeral will be a diplomatic occasion as well as a ceremonial one, given the rarity of such a meeting of heads of state and government.
After reflecting on the life of the Queen, discussion among many world leaders is expected to turn to the state of the world economy and the invasion of Ukraine.
President Volodymyr Zelenskyy has been invited and although his security chiefs are said to have considered ways he could attend, with the help of the British government, it is thought he is unlikely to risk leaving the country.
The Ukrainian Prime Minister is more likely to go and Zelenskyy’s wife, First Lady Olena Zelenska, may travel too.
But Britain is facing a diplomatic backlash against requirements that some foreign heads of state attending the funeral should leave their vehicles at a site outside central London to take a shared coach to Westminster Abbey.
“It would be a real challenge to convince anyone back home that this is a good look,” said one London-based foreign diplomat who is expecting their head of state to attend.
“It’s just not very dignified” they said about plans to allow select leaders like Joe Biden to make normal travel arrangements, while others must use a so-called "VIP park and ride".
An Israeli official confirmed to ITV News that president Isaac Herzog will also drive straight to the Abbey for security reasons.
Some leaders who have said they will come to pay their respects have yet to commit to travelling to the ceremony itself.
Watch ITV News' continuous live coverage of mourners queuing to pay their respects to the Queen Lying in State in Westminster Hall
For example, a source confirmed that Crown Prince Mohammed bin Salman will lead the Saudi delegation but could not explain why he has yet to confirm he will attend the funeral service.
Some of the plans for Monday’s funeral were still being altered at the last minute by officials across Whitehall.
A plan to close air space around the ceremonial venues from 9am until 7pm on Monday to ensure pin drop-silence were dropped earlier this week because of the impact that would have on tens of thousands of air passengers.
Blanket restrictions were scaled back at the eleventh hour so that at Heathrow there will be no arrivals during the hearse procession and no departures as the focus moves to Windsor.
Despite the decades of organisation - of constantly changing maps and spreadsheets, of dusty files from the twentieth century which became PDFs in the twenty first - some arrangements are up in the air, even as high-profile visitors arrive in London.