Joe Biden gave a somber farewell address to the United Nations on Tuesday, using his own decision to drop out of the US presidential election to warn of the dangers of autocrats clinging to power around the globe.
The 81-year-old called on world leaders to stand up for democracy in the face of spiraling turmoil and conflict, urging support for Ukraine and pushing for peace in the Middle East.
But with six weeks until a vote that could bring the isolationist and election-denying Donald Trump back to power in the United States, Biden closed his speech by drawing lessons from his own life.
"This summer, I faced a decision whether to seek a second term as president. It was a difficult decision. Being president has been the honor of my life, there's so much more I want to get done," Biden said.
"As much as I love the job, I love my country more. I decided after 50 years of public service it's time for new generation of leadership to take my nation forward," he added.
The audience then applauded as he said: "My fellow leaders, let us never forget, some things are more important than staying in power."
"It's your people that matter the most."
Biden quit the White House race in July after a disastrous TV debate against Trump fueled concerns about his age, and he has endorsed his vice president Kamala Harris as the Democratic nominee.
Countries around the world are now nervously watching the November 5 election amid fears that a Trump victory over Harris would bring back his hardline foreign policy.
Viewing his presidency as a return from the brink after Trump's four years in the Oval Office, Biden is trying to make sure his achievements are, in the words of one advisor, "irreversible."
- 'Crisis and uncertainty' -
Biden himself noted that he "came to the presidency at another moment of crisis and uncertainty", just days after pro-Trump supporters stormed the US Capitol to try to stop lawmakers certifying Biden's election victory.
Trump still falsely claims he won the 2020 US presidential election and has repeatedly refused to say he would accept the result if Harris wins this time.
During his speech Biden also pushed the importance of US alliances that he has tried to bolster after the Trump years.
His Republican predecessor threatened to leave the NATO military alliance and was keener on summits with Russia's Vladimir Putin and North Korea's Kim Jong Un than with allies.
Biden said that "Putin's war has failed" in Ukraine and warned that Kyiv's allies "cannot let up" their support for Ukraine.
He is due to host Ukrainian President Volodymyr Zelensky -- who was in the hall at the UN to watch Biden's speech -- at the White House for talks on Thursday.
Biden's UN swan song, which also includes a speech on climate and hosting a Ukraine reconstruction conference, is part of a wider attempt to burnish his legacy at home and abroad.
In an emotional moment Sunday, on the eve of the assembly, former president Bill Clinton presented Biden with the "Clinton Global Citizen Award" at a surprise ceremony in New York.
Biden held a cabinet meeting last week to urge a "sprint to the finish" to promote his policies -- and to give any reflected glory to Harris in an agonizingly close election.
His director of communications Ben LaBolt said in a memo to White House staff that the administration should "put a stake in the ground for the future" -- and, in a clear swipe at Trump, spoke of how Biden had restored "decency and dignity to the White House."
By Aurelia End With Danny Kemp In Washington