JERUSALEM — President Obama called on Israeli students Thursday to promote peace during his trip to the Middle East.

"Only you can determine what kind of democracy you will have," Obama told several hundred diverse students – Jews, Muslims and Christians – in a speech given in a Jerusalem convention center. He called on them to remember that when they make those decisions, "You will define the future of Israel as well."

Obama said the only way for Israelis and Palestinians to achieve peace is through negotiations. He tried to reassure the Israelis that the relationship between the U.S. and Israel is strong enough for Israelis to take risks for peace.

Obama acknowledged that Israelis "live in a neighborhood where many of your neighbors have rejected your right to exist. Your parents lived through war after war to ensure the survival of the Jewish state. Your children grow up knowing that people they have never met hate them because of who they are, in a region that is changing underneath your feet."

At the same time, the president told them, "the Palestinian people's right to self-determination and justice must be recognized" not only for the sake of the Palestinians, but to bring peace to Israel.

He asked the students to put themselves in the Palestinians' shoes, to "look at the world through their eyes."

"It is not fair that a Palestinian child cannot grow up in a state of her own, and lives with the presence of a foreign army that controls the movements of her parents every single day."

The president also addressed the United States' bond with Israel, noting the security relationship between the two nations has "never been stronger."

Reiterating that Israel has a "right to defend itself," Obama called on Hamas to renounce violence, and affirmed the United States' stance that Hezbollah is "a terrorist organization."

After hecklers briefly interrupted Obama, he said, "This is part of the lively debate that we talked about. … I wouldn't feel comfortable if I didn't have at least one heckler."

Many of the Israeli university students — who had to win a lottery to obtain tickets — spent hours on the road to catch a glimpse of the American president they had heard so much about.

While some Israeli politicians reportedly felt snubbed by Obama's decision to speak to ordinary Israelis and not to the parliament, the students said they were glad Obama didn't cave into diplomatic pressure.

Binyamin Mittelman, a 27-year-old student from Ben-Gurion University, in the southern city of Beersheva, called the speech "inspiring. He reminded us that we, the younger generation, can make a difference."

Reut Caspi, an Orthodox Jewish student at Bar-Ilan University near Tel Aviv, agreed with the president that Palestinian children deserve to live in peace, "but not at the expense of Israeli children."

Joseph Schwartz, another Bar-Ilan student, expressed doubts that the Palestinian public is ready to recognize that Jews have a right to their own country.

"I doubt Obama's speech, which acknowledged Jewish history and Jewish statehood, would receive the same positive response in Ramallah," he said.

While Randa Sharkiya, an Arab citizen of Israel studying at Al Qaesmi College in the north of the country, said she was gratified that Obama expressed his support for a Palestinian state, she was offended by the lack of any mention or outreach to Israel's many minorities.

"The entire speech was Jewish country, Jewish, Jewish Jewish," said Sharkiya, dressed like her classmates in Islamic headscarves. "All I kept thinking was, 'What about us?'"

Katharine Lackey reported from McLean, Va.

President Obama tours Jordan's ancient city of Petra on March 23. (Photo: Pablo Martinez Monsivais, AP)

U.S. security personnel patrol the ancient city of Petra, Jordan, ahead of the arrival of President Obama. Obama toured the fabled city on Saturday, described the landscape of soaring red rock cliffs as "amazing." (Photo: Mohammad Hannon, AP)

Israeli President Shimon Peres, left, watches as President Obama shakes hands with Israeli Prime Minister Benjamin Netanyahu at Ben Gurion International Airport. Obama concluded his first visit to Israel and the West Bank after three-days of meetings with Israeli and Palestinian leaders. (Photo: Lior Mizrahi, Getty Images)

Israeli President Shimon Peres, left, President Obama and Israeli Prime Minister Benjamin Netanyahu observe a moment of silence in the Hall of Remembrance at the Yad Vashem Holocaust Museum in Jerusalem. The museum is a memorial to the six million Jews killed by the Nazis during World War II. (Photo: Saul Loeb, AFP/Getty Images)

Israeli Prime Minister Benjamin Netanyahu, left, President Obama and Israeli President Shimon Peres leave the grave of Theodore Herzl after a wreath laying ceremony at the Yad Vashem cemetery at Mount Herzl in Jerusalem. Herzl is the founder of the political form of Zionism. a movement that established a Jewish homeland in Palestine. (Photo: Kobi Gideon, GPO, via Getty Images)

Israelis shout slogans during a protest against President Obama's visit. The activists are demanding the release of Jonathan Pollard, a Jewish American who was convicted in 1987 on charges of spying for Israel. (Photo: Lior Mizrahi, Getty Images)

Relatives of Palestinians held in Israeli jails burn posters of President Obama during a protest against his visit at the Jabalyia refugee camp in the northern Gaza Strip. (Photo: Mahmud Hams, AFP/Getty Images)