The world was treated to a display at the official memorial service for Nelson Mandela of how South Africa was freed from apartheid and became a democracy: a feisty, even bloody-minded citizenry determined to have its say, backed by massive international support.

Add to that a resilience of spirit which enables them to turn a time of mourning into one of joyous celebration of the life being remembered.

The singing and dancing – probably strangely in Western eyes – has been going on since the night that Madiba died, outside the home in Houghton, Johannesburg, where he had received round-the-clock medical care since his release from hospital; then outside the little house in Soweto to which he returned upon his release from prison in 1990; then spreading around the country.

South Africans know how to party, African Americans often say, and they've certainly demonstrated it this week. But it's not been a celebration insensitive to the feelings of those who mourn.

Perhaps the person who came closest to explaining the phenomenon was Bishop Ivan Abrahams, the South African general secretary of the World Methodist Council, who said in his sermon at the service at Soweto's Soccer City: "What brings us here today is not so much grief but love."

And the outpouring of love across South Africa this week has been extraordinary. The crowds, the flowers, the pinned-up prayers, the tears and the laughter give expression to South Africans' appreciation of a great life, lived with integrity and fortitude.

Even those who thought they were long inured to Madiba's dying – who even welcomed his release from the discomfort, and probably suffering, to which the attempts to keep him alive in recent months had subjected him – were surprised at how often the tears welled up in the days after his death.

The bloody-mindedness was seen when Cyril Ramaphosa, deputy president of the ruling African National Congress, was called upon as master of ceremonies at the service to exercise all the skills he had developed as a mineworkers' union leader in the 1980s to keep the crowd under control after sections of it began to boo President Jacob Zuma.

The ANC was fortunate that Ramaphosa was doing the job: he had the experience of heading the committee which had to keep events from spinning out of control when Mandela was released in February 1990. And with a reputation as a leader not embedded in the Zuma faction of the ANC, Ramaphosa was probably the person most likely to be listened to.

It's difficult to judge a person's popularity with a crowd by the volume of the cheers or the boos – judgements can differ depend on where one stands or where the media microphones are set up. But there was no mistaking Zuma's unpopularity with a substantial section of the crowd; at one stage local news channel eNCA was reporting that large monitors in the stadium had been turned off to stop the boos every time a camera rested on Zuma.

Ramaphosa battled to keep control, with repeated appeals to discipline. It was an occasion tailor-made for Desmond Tutu, whose rhetoric channelled the emotions of angry crowds in the 1980s, but he was on the programme only for the benediction at the end and by the time he told the stadium that "I want to hear a pin drop," the service was over and thousands were streaming home.

There was also no mistaking the relative popularity in the eyes of the crowd of former president Thabo Mbeki, who Zuma displaced as party leader in controversial circumstances. Humiliatingly, Zuma today experienced the treatment Mbeki faced at the hands of the party congress which chose Zuma over him, when people in the stadium began to emulate the gesture of football fans when they want a player off the field: the rolling of their hands.

It wasn't only Mbeki who was cheered – so too was Kgalema Motlanthe, deputy president of the country, who unsuccessfully challenged Zuma's party leadership last year; Winnie Madikizela-Mandela, a regular critic from the sidelines of the failings of both the Mbeki and Zuma administrations; George Bizos, who fled the Nazis in Greece in a small boat with his father, studied law with Mandela in Johannesburg, then became his defence counsel and a lifelong friend; and even F.W. de Klerk, South Africa's last white president.

There was no way for the ANC's chief spokesperson to spin himself and his party out of what happened to Zuma: questioned on it by on a local television station, he had to resort to explaining that the service had been open to all South Africans – not simply to members of the governing party. Which of course, four or five months before an election, was precisely the interviewer's point.

Moeletsi Mbeki, analyst, commentator and the son of Govan Mbeki, one of those sentenced to life imprisonment with Mandela – and the independent-minded brother of Thabo Mbeki – told BBC World he wasn't surprised by the crowd's actions. South Africans expected their leaders to keep to the straight and narrow, he said, and would take whatever chance they had to tell them when they didn't.

Then there was the world's support, stunningly on show in the way in which around 90 heads of government and of state dropped everything to fly in for the service at a few days' notice. Of course, not all the predecessors of the leaders present had backed anti-apartheid forces: as late as the 1980s, the conservative governments of the time in Britain, Germany and the United States were defiant hold-outs.

Nevertheless, South Africa did enjoy international backing for the struggle against apartheid which was second-to-none in the decolonisation process of the late 20th century. Sometimes it seems South Africans have taken that support for granted, especially when you consider the relative lack of urgency given to the plight of other Africans who suffer – such as those in the Central African Republic are doing now.

But the appreciation was clearly on display at Soccer City as the foreign leaders arrived: in the cheers for Ban Ki-moon, representing the United Nations' anti-apartheid record; for Robert Mugabe, Goodluck Jonathan and Raul Castro, representing the support of African states and fellow revolutionaries around the world; and finally – and loudest – for the person who cut his political teeth in anti-apartheid agitation against his government, "our very son of the African soil", Barack Obama – who then went on to steal the show.