Updated

President Obama said Friday he's "very concerned" that civil war-racked Syria could become a haven for extremists, should President Bashar Assad leave a power vacuum in the chaotic country.

Obama, during a press conference with Jordan's King Abdullah II, reiterated that Assad must, and will, go. But he stressed that it's critical for the international community to work together to accelerate a viable political transition -- one that does not let extremists exploit the power gap.

"I am very concerned about Syria becoming an enclave for extremists, because extremists thrive in chaos," Obama said.

Both Obama and the Jordanian king addressed the mass killing in Syria, with the king indicating he would keep his borders open to the thousands of refugees fleeing the country.

"Something has been broken in Syria, and it's not going to be put back together perfectly immediately -- even after Assad leaves," Obama said. "But we can begin the process of moving it in a better direction, and having a cohesive opposition is critical to that."

More On This...

    More than 400,000 refugees have crossed into Jordan to escape two years of bloodshed at home, crowding refugee camps and overwhelming aid agencies run by this important U.S. ally in the Middle East. Jordan's King Abdullah II has also voiced fears that extremists and terrorists could create a regional base in his country.

    Jordan stands as a key ally to the United States in the region, which is why Obama was closing out his trip to the Middle East there. The president spent most of the trip in Israel, marking his first visit to the country as commander-in-chief.

    Obama also sought to bolster Jordan's efforts to reform its government in an attempt to stave off an Arab Spring-style revolution that has led to the downfall of longtime leaders in Egypt, Tunisia and Libya.

    About to wrap up the tour, Obama also said Friday that he still endeavors to bring Israelis and Palestinians to the negotiating table -- after failing to advance the process during his first term.

    "The mistrust is building instead of ebbing," Obama warned Friday, before saying: "We'll see if we can make it happen."

    After Air Force One touched down at Queen Alia International Airport in the capital of Amman, Obama was Friday greeted on the red-carpeted tarmac by U.S. and Jordanian officials before the half-hour drive by motorcade to al-Hummar Palace. There, he and Abdullah reviewed the troops assembled in a courtyard, including some sitting on camels, before they retired inside for meetings. Large U.S. and Jordanian flags flapped in the wind.

    On Saturday, Obama planned several hours of sightseeing, a tour of the fabled ancient city of Petra before the return trip to the White House.

    Before arriving in Jordan, Obama closed a three-day visit to Israel, another important U.S. ally in the region, by paying respects to the nation's heroes and to victims of the Holocaust. He also solemnly reaffirmed 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 afterward that the memorial illustrates the depravity to which man can sink but also serves as a reminder of the "righteous among the 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, 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."
    Before leaving for Jordan, Obama and Netanyahu met for two hours over lunch. An Israeli official said they discussed Israel's security challenges and that, in addressing the peace process with Palestinians, Netanyahu stressed the importance of security. The officials spoke on the condition of anonymity under diplomatic protocol.

    The two leaders met again in a trailer next to a tent on the tarmac at Ben Gurion Airport in Tel Aviv before Obama left the country.

    In between those meetings, Obama squeezed in a stop in Bethlehem in the West Bank to visit the Church of the Nativity.

    Obama had been scheduled to take a helicopter to Bethlehem but had to change plans due to unusually high winds. The route gave Obama a clear look at Israel's separation barrier with the West Bank, which runs south of Jerusalem and is the subject of weekly protests by Palestinians.

    About 300 Palestinians and international pilgrims gathered near the Nativity Church, awaiting Obama's arrival. But a knot of protesters along the route held up signs stating: "Gringo, return to your colony" and "US supports Israeli injustice."

    At a nearby mosque, Mohammed Ayesh, a Muslim religious official in Bethlehem, issued a plea to Obama in a speech to worshippers: "America, where are your values? Where are the human rights? Isn't it time that you interfere to make it stop?"

    Amid high security, Obama toured the church with Palestinian Authority President Mahmoud Abbas. They stopped at the Grotto of the Nativity, which is said to stand where Jesus Christ was born. About 20 children waving U.S. and Palestinian flags greeted Obama in a courtyard outside the sanctuary. He posed for photographs with Abbas and Bethlehem's mayor, Vera Baboun.

    Earlier in Jerusalem, Obama and his Israeli hosts arrived at the 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."

    The Associated Press contributed to this report.