JERUSALEM (CNN) -

President Barack Obama arrived in Jordan on Friday after scoring a diplomatic coup just before leaving Israel when Prime Minister Benjamin Netanyahu phoned his Turkish counterpart to apologize for an Israeli commando raid in 2010 that killed eight Turks and an American of Turkish origin in a Gaza-bound flotilla.

The apology, long sought by Turkish Prime Minister Recep Erdogan, brought a restoration of normal relations between Turkey and Israel, two vital U.S. allies in the Middle East, according to a statement from Netanyahu's office.

It happened in the phone call during a final meeting between Obama and Netanyahu at Ben Gurion International Airport in Tel Aviv minutes before Air Force One departed for Jordan.

The Israeli government statement said the apology included an offer of compensation.

Obama, who U.S. officials said also took part in the call at one point, issued a statement that welcomed the development.

"The United States deeply values our close partnerships with both Turkey and Israel, and we attach great importance to the restoration of positive relations between them in order to advance regional peace and security," Obama's statement said. "I am hopeful that today's exchange between the two leaders will enable them to engage in deeper cooperation on this and a range of other challenges and opportunities."

The last-minute diplomacy added a flourish to Obama's first foreign trip of his second term, which also was his first visit to Israel as president.

While the two nations have a key strategic partnership, with the United States supplying military aid and diplomatic support as Israel's most vital ally, Obama and Netanyahu had famously frosty relations during the president's first term.

With both beginning new terms after Obama's re-election last year and Netanyahu's recent formation of a new government, the president's visit this week was an opportunity to reset the relationship and signal unified positions on major issues such as the Middle East peace process and Iran's efforts to develop a nuclear weapon.

Obama and Netanyahu met several times during the president's three days in Israel, which also included a state dinner where Israeli President Shimon Peres awarded him the country's highest civilian honor.

Before leaving Israel, Obama paid tribute to the father of modern Zionism in a symbolic visit to Theodor Herzl's grave.

Joined by Peres, Netanyahu and U.S. Secretary of State John Kerry, Obama also visited the grave of former Prime Minister Yitzhak Rabin, who was assassinated in 1995.

Both stops were intended to bolster Obama's standing with Israelis by demonstrating his understanding of the history of the Jewish state.

Obama placed a stone at each grave from the grounds of the Martin Luther King Jr. memorial in Washington in a gesture to link the African-American struggle for freedom with the struggle by the Israeli people for a homeland.

The president also visited the Holocaust memorial Yad Vashem, where he turned up the "eternal flame" of remembrance of the millions of Jewish victims of Nazi death camps in World War II.

Obama called for the world to follow the example of nations that intervened in Nazi genocide.

"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

Jordan's King Abdullah II 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.

In addition, the country wedged between the Palestinian territories, Iraq and Syria has seen more than its share of refugees from them all. Jordan currently shelters more Syrian refugees than any other country -- more than 300,000, according to the United Nations.

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."