It was a coincidence that former President Barack Obama was back on the world stage a day after President Donald Trump had laid a rotten egg in Helsinki.

But Obama’s speech Tuesday in South Africa to commemorate Nelson Mandela’s 100th birthday was a welcome breath of fresh air that helped dispel some of the foul odor left by Trump’s summit with Russia’s despotic leader, Vladimir Putin.

RELATED: Obama delivers veiled rebuke to Trump in Mandela address

Trump went to Finland with much of the American public expecting him to hold Putin accountable for cyberattacks by Russian operatives trying to affect the outcome of the 2016 presidential election. Instead, Trump acted like he was under the sway of some Svengali magician who cast an obedience spell.

Despite clear evidence to the contrary gathered by U.S. intelligence agencies, Trump meekly accepted Putin’s denial of any Russian involvement. An attempt at reversing course today — read from carefully typed remarks — only emphasized the bizarre acquiescence the president displayed before the world.

Obama didn’t get into all of that. But Putin and Trump came to mind when he warned a packed Johannesburg audience that, “Strongman politics are ascendant, suddenly, whereby … those in power seek to undermine every institution or norm that gives democracy meaning.”

Who else but Trump could Obama have had in mind when he said, “We see the utter loss of shame among political leaders where they’re caught in a lie and they just double down and they lie some more?”

Obama’s appeal for positive, transformative leadership was a fitting way to pay tribute to Mandela, who spent 27 years in prison for helping lead the rebellion to end South Africa’s racist apartheid system and later become the country’s first black president. Mandela died in 2013 at the age of 95.

Mandela, in becoming a wise president beloved even by former adversaries, provided a model for leadership that Obama tried to follow, even if he didn’t always succeed. Trump, with his tendency to boss people around, would do well to use Mandela as a model too. Especially if he wants to be the kind of president whose legacy is celebrated rather than maligned.