U.S. President Barack Obama says there is no shortcut to resolving the decades-old conflict between the Israelis and the Palestinians, saying in a speech to the United Nations: "Peace will not come through statements and resolutions at the UN."

In a speech to the UN General Assembly in New York on Wednesday, Obama expressed frustration at the failure of both parties to bridge their differences.

Obama said Palestinians deserve to live in a sovereign state of their own, and their vision has been delayed too long. But a genuine peace will only come through compromise and negotiation, he said.

"Peace is hard," he said. "Peace will not come through statements and resolutions at the UN. If it were that easy, it would have been accomplished by now. Ultimately, it is Israelis and Palestinians who must live side by side. Ultimately, it is Israelis and Palestinians — not us — who must reach agreement on the issues that divide them."

Obama didn't specifically mention the plan by Mahmoud Abbas, president of the Palestinian Authority, to submit a formal application Friday for Palestinian membership in the United Nations, although intense efforts have been underway this week to discourage the move.

Instead, Obama focused on the general challenges of achieving peace, which he said can't be imposed on any country.

"Peace is hard" became his refrain during the speech, in which he also emphasized the U.S. has a "deep and enduring" friendship with Israel, whose security concerns he said must be recognized in any agreement between the parties.

"The deadlock will only be broken when each side learns to stand in the other’s shoes."

Obama devoted part of his speech to recounting the sweeping changes in the past year, especially in North Africa and the Arab world. Dictators have been ousted by democracy movements and Osama bin Laden is dead.

"And the idea that change can only come through violence is buried with him," the president said. "Something is happening in our world."

Speaking to reporters later, with Obama at his side, Netanyahu said he was grateful for the president's support for direct negotiations between Israelis and Palestinians. The UN route won't succeed, Netanyahu said before the two leaders held a private meeting.

The Obama administration has pledged to veto any Palestinian statehood bid, arguing that only direct peace negotiations, not a UN vote, would allow the Palestinians to achieve the benefits of statehood.

With peace talks stalled, the U.S. and international partners have been negotiating this week over the steps needed to bring the two sides back to the negotiating table.

The new approach being considered would see the "quartet" of Mideast peace mediators — the U.S., European Union, United Nations and Russia — issue a statement addressing both Palestinian and Israeli concerns and setting a timetable for a return to the long-stalled peace talks, officials close to the diplomatic talks said.

The simmering situation is far from the scenario Obama envisioned when he spoke at the UN a year ago.

"We should reach for what's best within ourselves," Obama said last September in pushing for a negotiated agreement on a sovereign Palestinian state. "If we do, when we come back here next year, we can have an agreement that will lead to a new member of the United Nations."

Palestinians have cited Obama's words as part of the inspiration for their quest this week at the UN. On Wednesday, Obama, too, mentioned his hopes of last year but reminded the other world leaders that he also said a real peace required an agreement between both sides.

Meanwhile, Netanyahu thanked Canadian Prime Minister Stephen Harper for his support for Israel as the two leaders met at the UN on Wednesday. Harper opposes efforts by the Palestinians to win United Nations recognition of statehood.

With files from CBC News