JERUSALEM — Wrapping up a three day visit to Israel, President Barack Obama paid respects to its heroes and to victims of the Holocaust, solemnly reaffirming the Jewish state’s right to exist.

Accompanied by Israeli Prime Minister Benjamin Netanyahu and President Shimon Peres, Obama laid wreaths at the graves of Theodor Herzl, the founder of modern Zionism who died in 1904 before realizing his dream of a Jewish homeland, and former Israeli Prime Minister Yitzhak Rabin, who was assassinated in 1995.

He also toured the Yad Vashem Holocaust memorial, declaring after that the memorial illustrates the depravity to which man can sink but also serves as a reminder of the “righteous among nations who refused to be bystanders.”

Friday’s stop at Herzl’s grave, together with Thursday’s visit to see the Dead Sea Scrolls, the ancient Hebrew texts, were symbolic stops for Obama that acknowledged that the rationale for Israel’s existence rests with its historical ties to the region and with a vision that predated the Holocaust. Obama was criticized in Israel for his 2009 Cairo speech in which he gave only the example of the Holocaust as reason for justifying Israel’s existence.

“Here on your ancient land, let it be said for all the world to hear,” Obama said at Yad Vashem Friday, in a clear response to that criticism. “The state of Israel does not exist because of the Holocaust, but with the survival of a strong Jewish state of Israel, such a holocaust will never happen again.”

Later in the day, Obama was traveling to Jordan where he planned to meet with King Abdullah II. Among the topics is Jordan’s struggle with the influx of a half-million refugees from the Syrian civil war. Abdullah has voiced fears that extremists and terrorists could create a regional base in Jordan.

Before leaving for Jordan, Obama was to have lunch with Netanyahu and then tour the Church of the Nativity in Bethlehem.

Obama and his hosts arrived at the somber Herzl grave site under cloudless skies. Obama approached Herzl’s resting place alone and bowed his head in silence. He turned briefly to ask Netanyahu where to place a small stone in the Jewish custom, then laid the stone atop the grave.

“It is humbling and inspiring to visit and remember the visionary who began the remarkable establishment of the State of Israel,” Obama wrote in the Mt. Herzl guestbook. “May our two countries possess the same vision and will to secure peace and prosperity for future generations.”

At Rabin’s grave a short walk away, Obama was greeted by members of Rabin’s family. He initially placed a stone on Rabin’s wife’s side of the grave, then returned to place one atop Rabin’s side. In a gesture linking the U.S. and Israel, the stone placed on Rabin’s grave was from the grounds of the Martin Luther King memorial in Washington, the White House said.

Rabin, Obama told family members, was “a great man.”

Chatting with the family, Obama joked that “Bibi arranged for perfect weather,” using Netanyahu’s familiar name. He then added that “Shimon plied me with wine” at the official state dinner Thursday evening. At one point the talk turned to the singer who performed at the dinner, and Obama pointed out that he was known to sing, too. “They had me on YouTube,” he said with a laugh. “Check it out — Obama singing Al Green.”

At Yad Vashem, Obama donned a skull cap and was accompanied by Rabbi Israel Meir Lau, a survivor of the Buchenwald Concentration camp who lost both parents in the Holocaust. Among his stops was Yad Vashem’s Hall of Names, a circular chamber that contains original testimony documenting every Holocaust victim ever identified.

“Nothing could be more powerful,” Obama said.

Comments are no longer available on this story