After eight years of tense meetings, awkward public encounters and disagreement over key issues, President Obama and Israeli Prime Minister Benjamin Netanyahu are aiming to leave the impression that the relationship between their nations is on an even keel, much as they found it when they both came to office in 2009.
Each pointed Wednesday to the new deal guaranteeing the U.S. will spend $38 billion on military aid to Israel over the next 10 years as a sign of America's commitment to its ally.
"The bond between the United States and Israel is unbreakable," Obama said as the two shook hands on the pact at their meeting on the sidelines of the United Nations General Assembly.
"I don't think people at large understand the breadth and depth of the cooperation, but I know," Netanyahu said.
The united front, in their final planned get-together as leaders, papered over the tensions that have pervaded their tenure in office. As Obama prepares to leave office, he has built a record on Israel aimed at strengthening U.S. support but often overshadowed by his stormy personal encounters with Netanyahu.
Their relationship started off poorly at their first meeting in the spring of 2009, when Obama said he wanted to see a freeze on Israeli settlements in disputed territory. The request touched on a sore point for Netanyahu, though he relented that fall, imposing a 10-month moratorium of settlement housing starts as a gesture to the Palestinians.
Yet Obama spent much of the intervening months promising reconciliation with the Arab world and, on a trip to the Middle East, visited Muslim countries but skipped Israel, angering many there.
Obama has battled perceptions among many Israelis and some conservative American Jews that he lacked a true commitment to Israel. Republican presidential nominee Donald Trump has called Obama "the worst thing to ever happen to Israel."
But that viewpoint is largely belied by Obama's track record with the Middle East ally. In addition to increasing U.S. military aid to Israel to record levels and funding the Iron Dome missile defense system, the Obama administration has used its veto power at the U.N. to block Palestinian efforts to condemn Israeli settlements in the West Bank.
Though Obama pushed aggressively for a peace pact in his first term, including pressing Netanyahu to temporarily halt some settlement construction, the administration all but abandoned efforts once it became clear that a deal was out of reach.
Even the Iran nuclear deal, which Netanyahu vigorously opposed, eased the pressure on Israel — at least temporarily — to consider launching a military strike against Iranian nuclear facilities. And Syrian President Bashar Assad's agreement in 2013 to give up his nation's arsenal of chemical weapons to avert an impending U.S. airstrike allowed the Israeli government to terminate a years-long program to distribute civilian gas masks.
But Netanyahu, a nationalist leader with an open affinity for Republicans, never came around, even showing a preference for GOP nominee Mitt Romney during Obama's bid for reelection.
Obama visited Israel in 2013 in an attempt to soothe Israeli sentiment, but tensions peaked when Netanyahu accepted an invitation from House Republicans to address a joint session of Congress last year, surprising the president with the news only after making plans to speak. The end-around to the administration flouted diplomatic protocol, and once in front of U.S. lawmakers, Netanyahu denounced the potential nuclear agreement with Iran as a poor deal that endangered Israel.
Though it is still too early to say whether the nuclear pact, intended to block Iran's path to a nuclear bomb for 10 years, is a success, analysts in Israel view the deal as an achievement for Israeli security.
"The agreement is significant,'' said Arie Kacowicz, a professor of international relations at Hebrew University. "It avoided a possible war between Israel and Iran."
Aware that his record on Israel might always be colored by Netanyahu's portrayals of him, Obama aimed to write the final chapter with the $38-billion aid deal, the largest the U.S. has given to any nation.
"He is conscious that people say he is anti-Israel," Jon Alterman, a Middle East expert at the Center for Strategic and International Studies, said of Obama. "He thinks that's unfair, and this lets him leave a marker. Not only can he say he supported Israel, but he oversaw the largest military assistance package ever."
The signing of the memorandum of understanding with Israel was timed to maximize its exposure just before the U.N. General Assembly, when Netanyahu often uses his time at the podium to critique other nations' policy toward Israel. Officials in both governments see the security deal as a sign that the strategic ties are robust, despite the political bickering.
Israeli officials still worry that Obama will seek to engineer some sort of diplomatic game changer, whether by enumerating a set of peace parameters or by giving U.S. blessing to a resolution at the United Nations. The period between the U.S. presidential election and the inauguration has served as a time when other presidents have made precedent-setting moves on the peace process.
"The Palestinian issue has always sat deep in Obama's heart,'' Michael Oren, a minister without portfolio in Netanyahu's Cabinet and his former ambassador to the U.S., said in an interview with Israel Radio. "We can't rule out the possibility that he will say something on this. We need to be alert to the possibility that there might be a move in the Security Council.''
Obama has considered publicly outlining what he sees as the path to Middle East peace but will do so only if he thinks it will be "constructive," said deputy national security advisor Ben Rhodes.
On Wednesday, Netanyahu was under some internal pressure to shake hands with Obama before the cameras, with even some members of his own coalition worried that the prime minister has done too much to alienate the United States.
Over the years, aides have learned to make sure Obama and Netanyahu appear in front of photographers before they've had a long conversation, not after.
Obama was somber as he spoke, saying he hopes the parties will "keep alive" the possibility of a stable, secure Israel and of a Palestinian homeland.
"Our hope is that we can continue to be an effective partner with Israel," he said, adding, "I'm only going to be president for another three months."
Times staff writer Parsons reported from New York and special correspondent Mitnick from Tel Aviv.
Follow @cparsons for news about the White House.