Paris (AFP) - US President Barack Obama leaves office having put relations with Cuba on a new footing and helped secure a deal that the West hopes will stop Iran from building a nuclear bomb.
Yet the fall of Aleppo to government forces in December underlined what critics say was a flawed approach to the Syria conflict. Obama also faces accusations that he did little to further peace between Israelis and Palestinians.
Analysts from around the world have told AFP where they think Obama succeeded -- and where he failed.
- Iran nuclear deal -
The 2015 deal between Iran and the United States, Britain, China, France, Germany and Russia was hailed as historic because the West had long feared the Islamic Republic could acquire atomic weapons.
Abbas Abadi, a prominent Iranian reformist, said the agreement -- the result of years of negotiations -- showed Obama's ability to persuade others of the validity of his ideas.
"It was a result of policies by the Americans to which Iran responded positively," he said.
"The stronger country is the one that puts forward ideas and convinces others about it. That's what Mr Obama did."
But the agreement with Iran raised fears among Washington's allies in the region, mainly Israel and Saudi Arabia, which have welcomed Donald Trump's pledge to tear up a deal he calls a "disaster".
- Israeli-Palestinian conflict -
As was the case with many US presidents before him, the conflict at the heart of the Middle East defeated Obama. His relationship with Israeli Prime Minister Benjamin Netanyahu deteriorated badly, and the Palestinians felt let down as well.
Samir Abdullah, a professor of political studies at Birzeit University in the West Bank, offered a withering assessment.
"There are absolutely no positives for Obama's (legacy) on the Palestinian-Israeli conflict, from the day he was elected until he leaves," he said.
Professor Shmuel Sandler at the Begin-Sadat Center for Strategic Studies said Obama "never managed to inspire confidence in Israelis".
"By pinpointing the (Israeli) settlements as the main problem to relaunch peace talks, he failed -- in Israelis' eyes -- to sufficiently condemn Palestinian terrorism."
- New deal with Cuba -
Last year, Obama put an end to decades of hostility between the United States and the Caribbean island just 90 miles (145 kilometres) away.
"The opening with Cuba defined Obama's legacy in Latin America. With that bold stroke, he removed one of the main irritants in US-Latin American relations for decades," said Michael Shifter, president of Inter-American Dialogue, a Washington think tank.
"The policy shift created enormous good will towards Obama in the region, across the political spectrum," he added.
- Syria and the 'red line' -
Many analysts see the Syrian conflict as a stain on Obama's foreign policy. When government forces were accused of using chemical weapons, Obama failed to carry through on his threat to act against President Bashar al-Assad if he crossed this "red line". It allowed Russian President Vladimir Putin to step in and swing the war in Assad's favour.
Noah Bonsey, senior analyst at the International Crisis Group, said the Obama administration's approach to Syria was based on an early miscalculation: "The Obama administration took the step of supporting a popular uprising that had no conceivable non-military path to success."
But he said US forces are still deeply involved in the "multi-faceted war" against the Islamic State jihadist group, which fed off the chaos in Syria.
- 'Pivot' to Asia -
Obama poured resources and time into Asia, making it a diplomatic and economic priority for the US to counter the growing influence of China.
Jia Qingguo, a professor at Beijing University's International Relations Institute, said initial optimism that Obama would foster good relations with Beijing eventually evaporated.
"Naturally, a lack of mutual trust had a relatively large effect on cooperation on several issues. So it wasn't very smooth," Jia said, pointing to the lack of a bilateral investment agreement as a low point.
But Obama did succeed in helping to coax China to give crucial support to the 2015 Paris deal to combat global warming.
And Yoshinobu Yamamoto, professor of international politics at the University of Niigata Prefecture in Japan, said he believes Obama deserves credit for his dogged efforts to conclude tough negotiations on the Trans-Pacific Partnership (TPP) trade deal.
He noted, however, that with Trump threatening to pull out of the trade pact, Obama's effort "has not ultimately borne fruit".