In the week since President Barack Obama left Israeli soil, the White House and pundits across the political spectrum have hailed the commander in chief’s first visit to the Holy Land as a phenomenal success, focusing especially on the reconciliation deal the president brokered between Israel and Turkey. Since the May 2010 Mavi Mamara incident—in which Israeli commandos boarded the Turkish-sponsored ship set out to break Israel’s maritime blockade of Gaza and killed nine Turkish citizens who attacked them—relations between the two countries have been strained. Yet in a matter of days, Obama seemed to mediate a resolution to a three-year-long dispute that has set these once strategic allies at odds.According to Obama’s senior advisers quoted in the New York Times, the president “prodded” Israeli Prime Minister Benjamin Netanyahu to apologize to Turkish Prime Minister Recep Tayyip Erdogan, with Obama “raising the importance of a makeup phone call every day he was in Jerusalem.” Netanyahu’s apology, according to the Washington Post, was “bowing to a long-standing Turkish demand.”The reality is somewhat different than the official administration account. Jerusalem has long been looking to mend relations with its onetime strategic ally in Ankara. Contrary to popular narrative, it was Erdogan who was intransigent—not Netanyahu. Nor was Obama the prime mover here, “prodding” the Israeli prime minister to do his bidding. If anything, it was Netanyahu who used the commander in chief as something like a blunt instrument to force Erdogan to accept the same deal that his government had first put on the table at least 18 months prior: Israel would apologize; it would pay compensation; but it would not, as Erdogan had demanded, end the maritime blockade of the strip.From Netanyahu’s perspective, it’s all to the good that Obama is getting the credit for the reconciliation. Bibi got what he wanted from Erdogan and gave Obama a big trophy to put on his shelf. The Turkish premier, despite his bluster, has little choice but to swallow it, and the American president now owes Bibi a favor. Netanyahu—often denigrated as a clumsy politician and preachy ideologue—is in fact a much more adroit statesman than he is typically believed to be.***As Israel’s ambassador to the United States Michael Oren told Newsweek’s Eli Lake, Israel and Turkey, “along with the United States had long been working to resolve the dispute.” Israel made overtures as early as the summer of 2011.But two years ago there were two problems standing in the way: Erdogan and Avigdor Lieberman, then Israel’s foreign minister. Lieberman didn’t want Israel to apologize, condemning Netanyahu publicly for his inclination to make up with the Turks. That hardline position cost Lieberman little since he knew as well as Erdogan that there was never going to be a deal as long as Ankara demanded that Israel end the naval blockade.The contours of the agreement, including some of the specific wording, that was finally struck last week were worked out as early as that same summer. “The broad outlines of the deal,” wrote analyst Efraim Cohen in August 2011, “suggest that Israel would offer a limited apology for ‘operational errors,’ and would pay compensation to the families of those who died.” As for Erdogan’s third demand—that Israel lift the blockade of Gaza—Israel was not going to comply.For some 18 months Erdogan continued to reject the deal that he came to accept last week, insisting that Israel meet Turkey’s demands, belittling Israeli envoys as “very weird,” and claiming that any country mediating had to ensure that his three main conditions were met.Clearly Erdogan’s three conditions were not met, a disappointment that he apparently came to terms with last month, when Turkish and Israeli negotiators hammered out the exact terms of the deal that came to pass last week. As the Turkish newspaper Radikal explained, Israel would apologize for “operational mistakes,” pay compensation, and Ankara would drop the demand that Israel lift the blockade. Thus, the stage was set for Obama’s entrance as mediator and his exit as peacemaker. In pocketing the deal until Obama’s visit, Netanyahu’s timing was perfect: He handed an American president a truly wonderful souvenir of his all too brief stay in the Holy Land.It’s true that Erdogan now seems to be backsliding, claiming that he never accepted a deal without Israel agreeing to end the blockade, though Israeli officials insist that he did. The Turkish prime minister is also now promising to go to Gaza to “monitor” the situation to ensure that Israel fulfills its obligation to lift the blockade. However, this will only make him vulnerable on two fronts.First, while Erdogan is reportedly one of the world leaders closest to Obama, the reality is that Bibi comes off as the helpful partner in this case—not Erdogan. Any more noise out of the Turkish prime minister and he may find out what’s like to have chilly relations with an American president, which, as Netanyahu can tell him, is not where you want to be.Second, and perhaps more important, Erdogan’s support of Hamas will expose him to criticism from his domestic rivals. Why is the prime minister of Turkey so eager to show his love for an Iranian client in Gaza when his opposition to Iran’s ally in Syria threatens Turkey’s security?Indeed, it seems Erdogan’s Syria policy is largely responsible for his turnaround and willingness to accept Israel’s apology. It’s perhaps true, as some analysts argue, that given the situation in Syria, including Assad’s use or potential use of chemical weapons, the Turks’ need for intelligence cooperation with Israel helped change Erdogan’s mind. But there’s a much larger strategic issue at play here as well.As I argued earlier this month, Erdogan’s Syria policy has proven unpopular at home and has also demonstrated the limits of Turkish power. Erdogan was not able to stop Syrian President Bashar al-Assad’s killing machine, nor was he even able to prevent Assad from launching artillery rounds at Turkish towns across the border or shooting down a Turkish jet.As long as Erdogan and Turkish Foreign Minister Ahmet Davutoglu believed that Turkey was a rising regional power, Ankara could afford to hold its ground, making ridiculous demands of Israel that no state could possibly agree to. It was only when Assad and Syria shattered the Neo-Ottoman dream that Turkey started to see the wisdom of scaling back its regional ambitions and its demands on Israel.What Obama truly deserves credit for—and it’s no small thing—is realizing that an ally in whom he’d invested so much confidence was essentially a blowhard. Moreover, he saw that Israel, with whom he’d had contentious relations, was an ally he could count on. And that’s a very big win in Netanyahu’s column.***Like this article? Sign up for our Daily Digest to get Tablet Magazine’s new content in your inbox each morning.Lee Smith is the author of The Consequences of Syria.