"Here, alongside man's capacity for evil, we are also reminded of man's capacity for good," he said. "The rescuers, the righteous among nations, who refused to be bystanders, and in their noble acts of courage, we see how this place, this accounting of horror, is in the end a source of hope."
In another cultural stop Friday, Obama also visited the Church of the Nativity in Bethlehem, which is on the West Bank, with Palestinian President Mahmoud Abbas.
After putting himself in the middle of the historic tensions between Israelis and Palestinians this week, Obama then headed to Jordan, a military and intelligence partner that has been facing trying times.
Jordan's leader under duress
Abdullah has a reputation for benevolence, unlike autocratic rulers such as Syria's Bashar al-Assad or deposed Iraqi dictator Saddam Hussein. One house of the Jordanian parliament is democratically elected.
However, a bad economy and allegations of corruption by public officials have stoked dissatisfaction with Abdullah.
Now, the country wedged between the Palestinian territories, Iraq and Syria faces more pressure from the refugees continuing to cross its borders.
In November, crowds took to the streets calling for Abdullah's downfall because of rising gasoline prices.
More recently, comments attributed to Abdullah in the The Atlantic caused further anger toward the king, who was quoted as calling the opposition Muslim Brotherhood a "Masonic cult" and referring to tribal elders in his country as "old dinosaurs."
The royal palace denied that Abdullah made the comments.
Young Israelis applaud Obama
In Israel, Obama tried Thursday to invigorate the stalled Middle East peace process, urging young Israelis to pressure their leaders to seek peace with Palestinians while acknowledging the Jewish state's historical right to exist and defend itself from continuing threats.
In a speech in Jerusalem that Obama had said would lay out his vision for the region, the president urged Israelis to look at the world through the eyes of Palestinians but also said enemies of Israel must change their rhetoric and tactics to reflect modern reality.
"You are not alone," Obama said in both English and Hebrew, prompting a standing ovation when he declared that "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."
When Obama mentioned the name of Abbas in his speech, some boos erupted in the Jerusalem Convention Center among the audience of mostly young Israelis. He also was interrupted at one point by a protester's shouts, causing the president to joke that the heckling "made me feel at home," in reference to the caustic political climate in Washington.
He urged Israelis to empathize with the plight of Palestinians, using direct and harsh imagery to make his point, and he drew applause when he criticized the Israeli government's controversial policy of building new settlements in disputed territories.
Symbols and gestures
Hours before the speech on the second day of his Middle East swing, two rockets fired from Palestinian-controlled Gaza landed in southern Israel.
They caused no injuries or major damage, but served as a symbolic welcome to Obama's visit to the West Bank later in the day.
In another symbolic moment, Obama received the Presidential Medal of Distinction on Thursday night from Peres at the state dinner that emphasized the close ties between their countries.
In what Netanyahu called a key development of Obama's visit, the leaders announced new talks on extending U.S. military assistance to Israel for another 10 years past the current agreement, which expires in 2017.
During his earlier visit to Ramallah in the West Bank, Obama stressed the need for direct talks between Israelis and Palestinians for a two-state solution.
"The Palestinian people deserve an end to occupation and the daily indignities that come with it," he said at a news conference with Abbas, adding that Palestinians deserve "a future of hope" and a "state of their own."
The core issues right now, Obama said, are achieving sovereignty for Palestinians and security for Israel.