An open-air stadium packed with as many as 95,000 mourners, and thousands more surging to get close. On the inside, four presidents of the United States — together overseas for what appears to be only the second time in history — and the leaders of most of the world, from Afghanistan to Zimbabwe.
The memorial service for Nelson Mandela on Tuesday will be the biggest security event in recent memory, and all planned on just five days' notice.
(Read more: The advice I received from Nelson Mandela: CEO)
South African police said that thousands of officers would be in place to direct traffic, protect the masses and help the bodyguards that the world's dignitaries bring with them. High government officials, mostly presidents and prime ministers, from at least 88 countries and world bodies will be there, according to an official list from the South African government.
"We will be on hand to make sure people are able to grieve in a safe environment," Lt. Gen. Solomon Makgale, a spokesman for the police, told The Associated Press.
He said that a task force of police, diplomats and intelligence personnel have been making plans and talking to foreign delegations who are on their way to Johannesburg for the memorial.
At FNB Stadium, where the memorial is scheduled to begin at 4 a.m. ET, workers on Monday were welding together a stage and installing bulletproof glass to protect President Barack Obama and other guests. Obama will speak at the service, after tributes by four of Mandela's grandchildren, by U.N. Secretary-General Ban Ki-moon and by an official of the African Union.
The Secret Service does not comment on specific security measures, but an official told NBC News that the presidential detail is used to short-notice trips and is prepared when they happen.
(His life in photos: Nelson Mandela: A man and his country)
In cases like the Mandela memorial, the service sends an advance team that works with agents already stationed in the area to build a security plan, working with local authorities.
The advance team in this case was sent in shortly after Mandela's death last week, the official said.
The cast of dignitaries traveling to South Africa is impressive: Former President George W. Bush and his wife, Laura, were on board Air Force One with Obama for the long flight over, as was Hillary Rodham Clinton, the former first lady and secretary of state.
Traveling separately were former Presidents Bill Clinton and Jimmy Carter — Carter as part of The Elders, a globetrotting collection of world leaders and diplomats, once including Mandela himself, who fly around promoting peace and human rights.
More from NBC News:
Gatherings of ex-presidents are rare, and exceedingly so outside the United States. It appears to have happened only once before: Feb. 8, 1999, when Carter, Gerald Ford, George H.W. Bush and the sitting President Clinton attended the funeral of King Hussein in Amman, Jordan.
Three presidents attended the funerals of Pope John Paul II, former Israeli Prime Minister Yitzhak Rabin and former Egyptian President Anwar Sadat.
At the Mandela service, the prime ministers of Britain and Canada will be there, as will the presidents of Brazil and France. Prince Charles is going. So is the king of Belgium and the heirs to the thrones of Denmark, Norway and Spain. Along with the U.N.'s Ban is his predecessor, Kofi Annan.
The last gathering in world history that compares to the Mandela service was probably the funeral of John Paul II, in 2005, which drew the heads of state of more than 70 countries.
That was in the more tightly controlled environment of the Vatican, however. In Johannesburg, The Associated Press reported that one of its reporters walked into the stadium Monday without being searched, showing only a European press card.
(Read more: What Nelson Mandela meant to South Africa's economy)
South African officials assured reporters that they would be ready.
"Whether we have 10 heads of state coming or 70 or 100, we do have the capacity and plans in place to facilitate their movement," said Makgale, of the national police.
If anything can be called a trial run for such an enormous public event, South Africa had it three and a half years ago — the World Cup soccer tournament, which closed with a ceremony, attended by Mandela himself, at the stadium in Johannesburg.
"I have not heard of any concerns," Ben Rhodes, a White House spokesman, told reporters aboard Air Force One for the Mandela trip. "South Africa hosted the World Cup, so they have experience hosting big crowds, although this is obviously a very unique event."
The last time Obama was in Africa was this past June, for visits to Senegal, South Africa and Tanzania, and the security detail was daunting. The Washington Post, citing a confidential planning document, reported that it had 56 support vehicles, including 14 limousines and three trucks loaded with sheets of bulletproof glass.
Hundreds of Secret Service agents were dispatched, and a naval ship with a fully staffed trauma center was stationed offshore, The Post reported. Fighter jets were readied to cover the president's airspace at all times.
(Read more: Richard Branson: Mandela embraced free markets, too)
That trip was planned a month in advance. Plans for mourning Mandela have come together only since Thursday.
Security officials in South Africa said that roads would be closed around the stadium Tuesday for several square miles, and that people would have to walk or take public transportation to get there.
Overflow crowds will be sent to smaller stadiums nearby, equipped with big video screens. Collins Chabane, a minister of the South African government, told reporters Monday that authorities had no guess how many people will try to attend.
"Once we see that the numbers are becoming unmanageable," he said, "access will be denied."