United Nations - Both sides would benefit if Israel recognized it cannot permanently occupy Palestinian land and if Palestinians rejected incitement and recognized Israel’s legitimacy, U.S. President Barack Obama told the United Nations on Tuesday.

Obama’s efforts to bring about an Israeli-Palestinian peace agreement have failed over the nearly eight years he has been in the White House, with the latest push by U.S. Secretary of State John Kerry collapsing in 2014.

U.S. officials have held out the possibility Obama could lay out the rough outlines of a deal - “parameters” in diplomatic parlance - after the Nov. 8 presidential election and before he leaves office in January, but many analysts doubt this would have much effect.

“Surely Israelis and Palestinians will be better off if Palestinians reject incitement and recognize the legitimacy of Israel ...(and if) Israel recognizes that it cannot permanently occupy and settle Palestinian land,” Obama said.

Speaking at the General Assembly annual gathering of world leaders at the United Nations for the last time as president, Obama also said Russia was trying to recover “lost glory” through force.

He warned Russia that if it “continues to interfere in the affairs of its neighbors, it may be popular at home, it may fuel nationalist fervor for a time, but over time it is also going to diminish its stature and make its borders less secure.”

Russia annexed Ukraine’s Crimean peninsula in 2014 after months of protests in Kiev ousted pro-Moscow Ukrainian President Viktor Yanukovich.

On the international dispute over the South China Sea, Obama said: “A peaceful resolution of disputes offered by law will mean far greater stability then the militarization of a few rocks and reefs.”

China claims almost all of the South China Sea, through which ships carrying about $5 trillion in trade pass every year. Brunei, Malaysia, the Philippines, Taiwan and Vietnam also have claims in the sea, which is also believed to be rich in energy resources and fish stocks.

In July, an arbitration court in The Hague said China’s claims to the waterway were invalid, in a case was brought by the Philippines. Beijing has refused to recognize the ruling.