Barack Obama implicitly but repeatedly rebuked Donald Trump’s political vision on Tuesday as he gave warning that the “politics of fear” threatened to destroy the liberal values underpinning the modern global order.

Making arguably his most important intervention since stepping down as US president last year, Mr Obama painted a bleak vision of a world turning its back on progressive tolerance and again embracing a narrative of racial nativism and protectionism.

Striking an almost Churchillian “voice in the wilderness” tone, the former president said that the international community stood “at a crossroads — a moment in time at which two very different visions of humanity’s future compete.”

“The politics of fear and resentment and retrenchment… is on the move,” he told a 15,000-strong crowd in Johannesburg. “It’s on the move at a pace that would have been unthinkable a few years ago.”

By convention, American presidents do not comment on the policies of their successors and Mr Obama was careful not to mention Mr Trump by name.