Diary: South Africans can once again declare their love of country
The sun had gone and along with it the last of the tourists. All day we had camped outside the Union Buildings in Pretoria, the place where I'd watched Nelson Mandela sworn in as president of the first non-racial democratic South Africa back in 1994.
Now I was braced for an early flight to Cape Town convinced that President Jacob Zuma was going to fight on and take his future to the floor of parliament. It was a battle he was destined to lose, but for days his mood had been defiant, warped by an utterly unmerited sense of victimhood.
Earlier in the day, he gave a rambling interview - more of a monologue actually - to state television in which he asked: "What have I done wrong?" I believe I heard the groans of an entire nation rolling up the steps of the Union Buildings past the statue of Mandela with his ever-beaming countenance and up to the fretful plateau were the media were encamped.
Suddenly there was activity. "Come the cameras, come now," a voice called out of the darkness. A presidential bodyguard walked towards us. "Come quickly, the nation is waiting." The media village had thinned out so it was a comparatively small group of us who climbed the steps and were ushered through the metal detectors into the small briefing room where, decades before, I remember watching a press conference by FW de Klerk in the dying days of apartheid.
A protocol officer stepped up to the microphone: "Please stand for the president of the Republic." Could this, I wondered, be the moment when Jacob Zuma recognised reality? Then in he walked. "Why are you all looking so serious?" the president joked, the last laugh of a presidency that brought moral shame on South Africa in abundant and regular instalments, the laughter at the end of a long, expensive joke played on his own people.
I was sitting at the front of the room, a few yards from him, close enough to see the anger behind the smile, listening as he reeled off the reasons why he should not be forced from the presidency. Two-thirds of the way through he switched to Zulu, the language of his ethnic group, and the same self-justifying tone continued.
I was beginning to revert to my original conviction. This battle would end up with a motion of no-confidence in parliament, a political knife fight that Zuma would lose but which could split the ANC, the oldest liberation movement on the continent. Then he uttered the fateful words. Did I hear him correctly? After all the denial and defiance? "…I therefore resign with immediate effect." He stepped back from the podium, joined his hands together and raised them and said goodbye. "We will meet again," he said. And he was gone. I wonder how many of us in that room had the same thought... we would see him again but would it be on the steps of courthouse probably as the long-postponed corruption charges finally came to trial?
Fast-forward 24 hours and I am in Cape Town. The Mother City of the Republic is parched from the worst drought in living memory. But the sun hammering into our skulls outside parliament cannot dissipate the energy of this moment. A small group of us is ushered into a room next to the president's parliamentary offices. There are journalists, cabinet ministers (the ones not too slavishly devoted to the old boss), the speaker of parliament, and the family of Cyril Ramaphosa. "Move back please, move back," the bodyguards plead.
"If we go back more we end up in the sea," one of my colleagues replies. Everybody around me begins to laugh, the politicians most of all. It is the laugh of relief, the laugh at the end of a nightmare that has evaporated with the coming of the morning. In a matter of minutes the new president is standing with his right hand raised and promising to uphold the constitution of South Africa. "So help me God," he says. The applause erupts.
Then the songs of the liberation struggle begin. No matter that some of those singing have spent nine years covering up for and enabling a leader who shamed the legacy of Nelson Mandela. Not right at this moment. This celebration does not belong to the politicians.
The star of the hour is a document forged in the exhaustion of long nights nearly a quarter of a century ago in a nondescript convention centre outside Johannesburg. I was there. I remember the painful breakdown of talks, the dead piling up in townships. There were days when we wondered if the country was heading for civil war. But a few determined men and women kept going, among them Cyril Ramaphosa, because they understood that the majority of the people wanted a peaceful Republic governed by the rule of law.
The constitution they wrote saved this country from a slide into corrupt despotism under Zuma. It protected whistleblowers and gave courage to the most independent media anywhere in the world. The Constitutional Court it created was the ultimate protection against what Thomas Jefferson called 'elective tyranny'.
I understand just how warped things became in the age of Zuma. I made a documentary warning of his character before he ever became president, asking him in an interview if he was a crook. I remember being condemned back then by people who are now rushing to denounce him.
But I never bought the idea of South Africa as a basket case. I rejected the lazy comparisons with failed states in other parts of the continent. This country has always been different. It is big, self-obsessed, fractious, frequently dysfunctional, scary at times, but somehow the bedrock of common sense across all ethnic groups preserves it from catastrophe.
I believe even Jacob Zuma was not, in the end, immune to the dictates of that common sense, just as the white leaders were two decades before. Now he is gone and the atmosphere is radically altered.
South Africans are back to their default selves. They believe they are the best people in the best country in the world. This despite the fact that they excoriate their country's failures on an hourly basis.
They love this land and these last few days have allowed them to declare that love once more.
Good morning from the city of good hope.
Fergal Keane is the BBC's Africa editor