JERUSALEM — Under persistent prodding from President Obama, Israel and Turkey resolved a bitter three-year dispute on Friday with a diplomatic thaw that will help a fragile region confront Syria’s civil war, while handing the president a solid accomplishment as he closed out his visit to the Middle East.
The breakthrough took place in the most improbable of surroundings: a trailer parked on the tarmac of Ben-Gurion International Airport. Moments before Obama left for Jordan, Prime Minister Benjamin Netanyahu telephoned the Turkish prime minister, Recep Tayyip Erdogan, and apologized for deadly errors in Israel’s 2010 raid on a Turkish ship that was trying to bring aid to Palestinians in Gaza.
After years of angrily demanding an apology, Erdogan accepted Netanyahu’s gesture and both sides agreed to dispatch envoys to each other’s nations, having recalled them in 2011.
The president’s involvement, a senior US official said, was crucial to both leaders, which is why Netanyahu scheduled the call before Obama’s departure from Israel. Erdogan insisted on speaking to Obama first before the president handed the phone over to Netanyahu. In the end, the call produced a win-win for all sides.
Obama achieved reconciliation between two of the United States’ most important allies, while Turkey and Israel won good will with the White House, important for two nations that have made ties to the United States central to their foreign policy.
Turkey and Israel, along with Jordan, have also been three pillars of stability for the United States as it confronts a civil war in Syria that threatens to spill beyond its borders and destabilize the broader region.
“Both of us agreed the moment was ripe,’’ Obama said of Netanyahu at a news conference later in Amman, Jordan. He cautioned that the detente was a ‘‘work in progress,’’ and Turkey and Israel would continue to have significant disagreements as they mended fences.
US officials say both countries are still ‘‘working the issue’’ of dropping criminal charges for four current and former top Israeli military officials that Turkey indicted for their roles in the flotilla raid, and of determining Israel’s compensation to Turkey.
Obama reiterated his support for Jordan, too, announcing after a meeting with King Abdullah that the United States would provide an additional $200 million in aid to help Jordan with the burden of caring for 460,000 Syrian refugees who have flooded into the country.
Israel and Turkey have a host of shared economic and security interests, and both are concerned about the unraveling situation in Syria.
Turkey also could play a strategic role in Washington and Jerusalem’s efforts to stop Iran from developing a nuclear weapon, as well as in resolving the Israeli-Palestinian conflict.
It was the Palestinian issue that opened the rift between the two, when Israeli commandos raided the Turkish ship, the Mavi Marmara, as it was trying to break Israel’s blockade of Gaza to deliver supplies. Nine people were killed in clashes on board, prompting an international outcry, several investigations, and a rebuke by the United Nations.
“The prime minister made it clear that the tragic results regarding the Mavi Marmara were unintentional and that Israel expresses regret over injuries and loss of life,’’ a statement issued by Netanyahu’s office said.
Erdogan’s office, in turn, said he had accepted the apology ‘‘on behalf of the Turkish people,’’ and that in his conversation with Netanyahu he had emphasized their nations’ shared history and prior eras of friendship and cooperation.
The call’s timing came as a surprise after a visit by Obama that was intensely symbolic, and publicly at least, tightly focused on Iran, Syria, and the peace process.
Obama used his trip to convince the Israeli public that he was a strong supporter and ally — credibility he then hoped to use to persuade the Israelis that it was safe, and wise, to earnestly embrace negotiations with Palestinians. Public reaction suggested that Obama did win the public trust, but it was not at all clear that he would achieve the second goal and prompt any significant movement in the long-stalled peace process.
Though important, the Turkey-Israel feud was less complex than those other problems.
Defusing it may be the only immediate, concrete achievement Obama can assert from his visit here, beyond a broad sense that he has improved his standing with the Israeli public.