TEL AVIV, Israel — U.S. Secretary of State John Kerry on Sunday wrapped up four days of shuttle diplomacy on a positive note, saying he had considerably narrowed the gaps between Israel and the Palestinians and that the resumption of negotiations could be “within reach.”

Kerry delivered the assessment after a final, frantic day of diplomacy that included a late-night meeting with Israeli Prime Minister Benjamin Netanyahu and a last-minute meeting in the West Bank with Palestinian President Mahmoud Abbas.

“I … know progress when I see it, and we are making progress,” Kerry told reporters at Israel’s international airport before departing to Brunei for an Asian security summit.

He would not elaborate, but said he would leave a team of aides in the region to continue the mediation efforts. He also said that at the request of both sides, he would return in the near future.

“We started out with very wide gaps and we have narrowed those considerably,” Kerry said. “We have some specific details and work to pursue but I am absolutely confident that we are on the right track and all of the parties are working in very good faith in order to get to the right place.”

Since taking office early this year, Kerry has been shuttling between Israel and the Palestinians in search of a formula to restart negotiations aimed at forging a final peace agreement. The talks seek to establish an independent Palestinian state alongside Israel.

Kerry’s visit was his fifth to the region as secretary of state, and the lack of any apparent progress has begun to generate skepticism on all sides.

But Kerry said he was convinced that both sides are serious about restarting peace efforts. Kerry extended his stay, canceling a visit to Abu Dhabi, in order to continue his peace efforts in Jerusalem, the West Bank and neighboring Jordan.

“I am pleased to tell you that we have made real progress on this trip and I believe with a little more work, the start of final status negotiations could be within reach,” he said. “I believe their request to me to return to the area soon is a sign that they share cautious optimism.”

The last substantial round of peace talks broke down in late 2008, and with the exception of a brief attempt at restarting negotiations in 2010, efforts have remained at a standstill.

The Palestinians seek a state in the West Bank, east Jerusalem and Gaza Strip, territories that Israel captured in the 1967 Mideast war.

The Palestinians have said they will not resume talks unless Israel stops building Jewish settlements in the West Bank and east Jerusalem, or accepts its pre-1967 frontiers as the basis for a future border. The Palestinians are also pressing Israel to release more than 100 of the longest-serving Palestinian prisoners it is holding.

Kerry is believed to be pursuing a package of incentives to both sides that would include economic aid to the Palestinians, some sort of slowdown in Israeli settlement construction, a prisoner release, security guarantees to Israel and assurances to the Palestinians that talks on borders will take place quickly.

Kerry declined to discuss what ideas were being discussed, saying that secrecy was needed for negotiations to take place in good faith. He also declined to set any deadlines or time limits.

“This has been years and years if it takes another week or two weeks or some more time that is minimal, minuscule compared to the stakes and what we are trying to do,” he said.

Netanyahu has insisted that talks begin immediately without any preconditions. But Netanyahu rejects a return to the 1967 lines and has allowed thousands of new settler homes to be built on his watch, raising Palestinian suspicions that he is not serious about peace.

Israel withdrew from Gaza in 2005, and the Hamas militant group’s takeover of the territory has added to the complicated task facing Kerry.

Addressing his Cabinet on Sunday, Netanyahu showed little signs of bending.

“We are not putting up any impediments on the resumption of the permanent talks and a peace agreement between us and the Palestinians,” he said.

At the same time, he said, “We will not compromise on security and there will be no agreement that will endanger Israelis’ security.”

He added that any agreement would be presented to the public in a referendum.

Critics have said such a step would merely add an additional obstacle to implementing any deal, which would require a broad pullout from the West Bank.

Following Sunday morning’s meeting in Ramallah, the chief Palestinian negotiator, Saeb Erekat, reported progress but said that gaps remained.

“I cannot say we have a breakthrough,” he said. “All I can say once again is no one benefits more from the success of secretary Kerry than the Palestinians, and no one stands to lose more from its failure than Palestinians.”