Mr Obama told the UN Gen­eral Assem­bly on Septem­ber 20 that democ­racy re­mains the “firmest foun­da­tion for hu­man progress” as he re­pu­di­ated “crude pop­ulism” that has mush­roomed in the United States and around the world.

“Some ar­gue the fu­ture favours the strong­man,” Mr Obama said, in re­marks that will echo in the 2016 US cam­paign as much as the Krem­lin or Tianan­men Square. “I be­lieve this think­ing is wrong.”

“His­tory shows that strong­men are then left with two paths: per­ma­nent crack­down, which sparks strife at home, or scape­goat­ing en­e­mies abroad, which can lead to war.”

Mr Obama’s solemn vale­dic­tory re­marks came less than 50 days be­fore Amer­i­cans de­cide whether fel­low Demo­crat Hil­lary Clin­ton or Mr Trump, the Repub­li­can nom­i­nee, will be his re­place­ment.

Trump, the bel­li­cose re­al­ity TV star, has taken far-right po­si­tions on im­mi­gra­tion and se­cu­rity on the cam­paign trail and into the US po­lit­i­cal main­stream.

Mr Trump lashed out at Mr Obama on Septem­ber 19 af­ter a spate of at­tacks in New York, New Jer­sey and Min­nesota, say­ing “our coun­try has been weak. We’re let­ting peo­ple in by the thou­sands and tens of thou­sands”.

Mr Obama chal­lenged that think­ing, say­ing, “We have to open our hearts and do more to help refugees who are desperate for a home.”

“We have to imag­ine what it would be like for our fam­ily, for our chil­dren if the un­speak­able hap­pened to us.”

But he ad­mit­ted there were “deep fault lines in the ex­ist­ing in­ter­na­tional or­der”, not least in the Mid­dle East where “ba­sic or­der has bro­ken down” and fun­da­men­tal­ists prey on so­cial un­ease.

He ad­mit­ted too that a “course cor­rec­tion” was needed to smooth the ser­rated edges of glob­al­i­sa­tion.

“A world in which one per­cent of hu­man­ity con­trols as much wealth as the other 99pc will never be sta­ble,” he warned.

Mr Obama had a more di­rect mes­sage for his Rus­sian coun­ter­part, ac­cus­ing Mr Putin – who has in­vaded Ukraine and de­ployed forces to Syria – of us­ing the mil­i­tary to gain global clout.

“In a world that left the age of em­pire be­hind, we see Rus­sia at­tempt­ing to re­cover lost glory through force,” Mr Obama said.

By the same to­ken, Mr Obama warned China’s in­creas­ingly pow­er­ful leader Xi Jin­ping that ad­her­ing to the rule of law of­fers “far greater sta­bil­ity than the mil­i­tari­sa­tion of a few rocks and reefs” in the South China Sea.