JERUSALEM (AP) -- President Barack Obama was interrupted by a heckler while giving a speech to an audience of Israeli university students, but he didn't lose his cool.
The president was talking about the U.S. being a close ally to Israel when the heckler piped up. The crowd shouted him down.
"This is part of the lively debate that we talked about," said an unruffled Obama. "This is good."
That got him a standing ovation from many of the students.
"I have to say we actually arranged for that because it made me feel at home," Obama said, grinning. "I wouldn't feel comfortable if I didn't have at least one heckler."
Obama went on to deliver an impassioned appeal for Israel to recognize that compromise will be necessary to achieve lasting security.
Obama has permitted TV crews with live microphones to accompany him at virtually every stop in Israel, giving a rare and fascinating glimpse at the joking and small talk that takes place on the sidelines of official visits.
In Jerusalem on Thursday, Obama and Israeli Prime Minister Benjamin Netanyahu visited the Israel Museum, where they examined the Dead Sea Scrolls. Reading a passage from Isaiah from a facsimile of a scroll, Netanyahu explained: "It says, 'Nations should not lift swords unto nations and they shall know war no more."
The phrase forms the lyrics to a popular Hebrew folk song often used as a rallying call for peace.
Obama marveled that the Hebrew language had not changed much over the centuries.
Minutes later, during a tour of a technology exhibit, the two leaders stopped by a display of a robotic snake that can burrow into rubble during rescue operations. The three-foot contraption wriggled and separated and reared up. "Let me just say, my wife would not like this," Obama said, grinning.
At a brain imaging display, a scientist explained that the first step in studying brain function is taking accurate measurements of the brain. "That presupposes there is something to measure, right?" Netanyahu joked.
Developers of a driver assistance device that detects road obstacles described how their Mobileye protected passengers by sensing a car's proximity to other cars.
"Pedestrians, too?" Obama asked. "Pedestrians, cars...," one of the developers replied.
"Dogs?" Obama wondered. "Not dogs," came the reply.
For Obama, this was personal. The president reflected repeatedly on his experience as a father and an African American as he contemplated the conflict between Israelis and Palestinians.
Standing alongside Palestinian President Mahmoud Abbas in Ramallah, Obama contrasted the experience of children growing up amid the conflict to that of his two daughters, who in an earlier period in American history would have been denied the opportunities granted to others.
"Those of us in the United States understand that change takes time, but it is also possible," he said.
Later, in Jerusalem, Obama cited Martin Luther King Jr. and likened the story of the upcoming Jewish holiday of Passover to the experience of blacks in the U.S. who were freed from slavery and persecution.
Of the Passover story, Obama added: "For me personally, growing up in far-flung parts of the world and without firm roots, it spoke to a yearning within every human being for a home."
And the president veered briefly off of his prepared remarks to scores of Israeli students to convey a lesson he took away from meeting earlier in the day with Palestinian students in the occupied West Bank.
"They weren't that different from my daughters. They weren't that different from your daughters or sons," he said. "I honestly believe that if any Israeli parent sat down with those kids, they'd say, 'I want these kids to succeed. I want them to prosper. I want them to have opportunities just like my kids do.'"
At the White House, Obama is used to bestowing medals on combat veterans, both living and deceased, as well as famous Americans, scientists, inventors and others.
But on Thursday, it was his turn to bow his head and accept one for himself.
During a state dinner at Israeli President Shimon Peres' official residence, Peres presented his American counterpart with the Medal of Distinction, the highest honor the Jewish state bestows on civilians. An announcer said it was for Obama's "unique and significant" contributions to Israel's security.
"This award speaks to your tireless work to make Israel strong," Peres said during his toast. Then he put the large, round medal dangling from a wide, dark-blue ribbon with a white stripe down the middle around Obama's neck.