The anti-apartheid icon had kept a low profile during the month-long tournament, having decided against attending the opening game following the death of his great-grand daughter.
Driven in a small golf cart alongside wife Graca Machel, a smiling Mandela was welcomed by a thunderous mix of vuvuzelas and roars from the crowd. He shook hands with officials before leaving the field a few minutes later.
Shakira, backed by South African Afro-fusion band Freshlyground, did one last rendition of the cup’s theme tune, ``Waka Waka (This Time for Africa)’’ after a lights show and fireworks.
Also performing Sunday was Grammy Award-winning cappella group Ladysmith Black Mambazo.
The ceremony was attended by heads of state from across Africa, including South Africa’s Jacob Zuma and Zimbabwe’s Robert Mugabe.
Dutch and Spanish royals were also present, as were Archbishop Desmon Tutu and former UN Secretary-General Kofi Annan. They were rubbing shoulders with the likes of model Naomi Campbell, tennis star Rafael Nadal and Oscar-winning actor Morgan Freeman.
Dancers wearing the colors of the 32 competing nations performed before a backdrop of pictures of stars and fans beamed onto the pitch; others dressed in white elephant costumes made their way onto the field toward large image of a watering hole.
Themes included pantsula and gumboot dancing and local jazz - all touchstones of South African music.
Dutch and Spanish fans led a carnival atmosphere before the match, embracing police officers outside the stadium and posing for photographs while blowing vuvuzelas, the horn whose sound has become synonymous with the 2010 tournament.
Some had doubted South Africa’s ability to stage a successful tournament, but the matches were played before mostly capacity and joyous crowds. The competition, the first to be held in Africa, was free of any major incidents.
“We are coming to the end of a historic, vibrant and very African FIFA Soccer World Cup,” South African President Jacob Zuma had said on the eve of the final as celebrities started swarming Johannesburg.
Extra flights from the Netherlands and Spain had jetted into Johannesburg as supporters scrambled to be part of the historic final that will see a first-time winner among either teams. Throughout the Netherlands entire streets were lined with orange flags and some homes have been covered with plastic sheets in the national colour.
And in Spain, at least 150,000 fans of La Roja (the Reds) crammed the centre of Madrid to watch the game.