President Barack Obama has told Israelis and Palestinians to demand their political leaders take greater risks to ensure peace.
On the second day of his tour of Israel, Mr Obama spoke of the need to build trust, because "peace is possible".
The president was briefly heckled while speaking to students at the Jerusalem Convention Centre, but laughed off the interruption, saying it was a sign of Israel's "lively debate".
There was prolonged applause from the Israeli students when Mr Obama told them "the only way for Israel to endure and thrive as a Jewish and democratic state is through the realisation of an independent and viable Palestine".
He added: "The Palestinian people's right to self-determination and justice must also be recognised. Put yourself in their shoes – look at the world through their eyes.
"Neither occupation nor expulsion is the answer. Just as Israelis built a state in their homeland, Palestinians have a right to be a free people in their own land."
Mr Obama also spoke of his "sense of an Israel that is surrounded by many in this region who reject it, and many in the world who refuse to accept it.
"That is why the security of the Jewish people in Israel is so important – because it can never be taken for granted. But make no mistake: those who adhere to the ideology of rejecting Israel's right to exist might as well reject the earth beneath them and the sky above, because Israel is not going anywhere.
"Today, I want to tell you – particularly the young people – that so long as there is a United States of America, ah-tem lo lah-vahd [you are not alone]. The question, then, is what kind of future Israel will look forward to."
He went on to discuss whether the Israeli public truly believed peace was possible, and acknowledged the threats posed by terrorist attacks and the "ugly reality of antisemitism".
Mr Obama said Israel stood at a "crossroads" and "only Israelis can make the fundamental decisions about your country's future".
The president is due to visit the Yad Vashem Holocaust museum and grave of assassinated Israeli Prime Minister Yitzhak Rabin tomorrow.
He concluded his speech: "We bear that history on our shoulders, and we carry it in our hearts. Today, as we face the twilight of Israel's founding generation, you – the young people of Israel – must now claim the future. It falls to you to write the next chapter in the story of this great nation.
"As the president of a country that you can count on as your greatest friend, I am confident that you can help us find the promise in the days that lie ahead.
"And as a man who has been inspired in my own life by that timeless calling within the Jewish experience – tikkun olam – I am hopeful that we can draw upon what's best in ourselves to meet the challenges that will come; to win the battles for peace in the wake of so much war; and to do the work of repairing this world."