U.S. Secretary of State John F. Kerry, left, meets with Israeli Prime Minister Benjamin Netanyahu in a Jerusalem hotel Friday. (Matty Stern/European Pressphoto Agency)

Secretary of State John F. Kerry claimed Friday that the prospect of achieving a long-elusive accord between Israelis and Palestinians is mounting, despite widespread skepticism that the talks he fostered are making headway.

“We are closer than we have been in years to bringing about the peace and prosperity and security” that both parties deserve, Kerry said. He also likened the effort to bring peace to the Middle East to the late Nelson Mandela’s long struggle to end apartheid in South Africa.

“It always seems impossible until it is done,” he said.

Kerry, speaking at Israel’s Ben Gurion Airport, also reassured Israelis that tough sanctions on Iran will remain in place during negotiations to achieve a deal limiting Iran’s nuclear program to peaceful purposes.

“We will approach this final negotiation with an absolute view about Israel’s security,” as well as the safety of the wider Middle East, he said as he prepared to fly to Washington after two days of talks in Israel and the West Bank.

Israeli Prime Minister Benjamin Netanyahu has been a vocal critic of the effort Kerry helped lead to broker an interim deal with Iran, which agreed to cap its nuclear program in exchange for limited relief from economic sanctions. Netanyahu’s blunt appraisal that the deal was a catastrophic mistake marked the most public breach with the United States in years.

“The prime minister has every right in the world to make his views known about the security of his country,” Kerry said.

Netanyahu toned down criticism during Kerry’s two-day visit, and Kerry publicly endorsed Israel’s focus on security, using the same terminology Netanyahu employs: that Israel must be able to defend itself by itself.

Standing with Netanyahu on Thursday, Kerry made no mention of Israeli settlements on land claimed by the Palestinians. Announcements of new construction in the Jewish settlements essentially brought talks to a halt in recent weeks.

After a meeting with Palestinian Authority President Mahmoud Abbas, Kerry acknowledged that the Palestinians see “difficulties” in the talks.

Kerry and retired Marine Gen. John R. Allen presented U.S. proposals for possible security arrangements in the West Bank if a peace deal is struck.

Details of Allen’s proposed security architecture remain secret, but people familiar with it have said it seeks to contain potential threats coming from Palestinian airspace and on the ground in the Jordan Valley, which is occupied by the Israeli army.

Offering a little sunlight, the new leader of the opposition in the Israeli parliament, Isaac Herzog, head of the Labor Party, said in an interview this week that Israeli and Palestinian leaders have “a golden opportunity” to strike a deal.

Herzog, who met with Abbas, described the Palestinian leader as receptive to “innovative thinking” on the security question. “He is showing flexibility,” he added.

“I think the two sides might not be as far apart as it seems,” Herzog said.

Booth reported from Jerusalem.