FEW believed that John Kerry, the American secretary of state, would manage to haul the Israelis and Palestinians back into the negotiating room, let alone get them to discuss anything of substance. Yet six months since talks began, he may be able to present, within weeks, a “framework agreement”, after which final details must be hammered out. Diplomats who had mocked his dogged prophetic conviction now sound shocked by his progress. Rejectionists on both sides who quietly presumed that the process would collapse under its own weight now express alarm.

Consternation and confusion are visible on the faces of some ministers in Binyamin Netanyahu’s Israeli government. The day that its justice minister was championing a negotiated two-state settlement at Jerusalem’s Hebrew University, its trade minister was damning it at Tel Aviv’s. No sooner had the foreign minister called for moving Israel’s Arab citizens into a Palestinian state as part of a land-swap, than the interior minister made a rare visit to a northern Arab town to hail its inhabitants as integral to Israel’s body politic. Mr Netanyahu, for his part, floats above the fray. “We’re lacking a leader,” says Dov Weisglass, once the close adviser of Ariel Sharon, the former Israeli prime minister who, as The Economist went to press, was on the verge of death, after six years in a coma.

Mr Kerry’s methodical midwifery may be paying off. His team of 120, including four generals, has almost as great a command of detail as do the Israelis and Palestinians. “What matters is a settlement, not lots of settlements,” says Mr Kerry.

He hugs the foreign minister, Avigdor Lieberman, a former firebrand who vilified Palestinians and was cordially detested by them in return, whereas his predecessor, Hillary Clinton, used to shun him. Mr Lieberman nowadays praises Mr Kerry for bringing peace closer than ever, and has turned the ten naysayers in his party’s parliamentary bloc into yes men. Yair Lapid, the finance minister, has come out strongly in favour, bringing onside his 19 parliamentarians, the second-biggest party in the 120-strong Knesset. Mr Kerry’s people have also courted the black-hatted Haredim, or ultra-Orthodox. All told, he has overseen a remarkable turnaround. After the election at the beginning of last year, a narrow majority in the Knesset would have shied from a negotiated two-state solution. Now, according to insiders, its members stand 85-35 or so in its favour.

That should give Mr Netanyahu room to move. But he is a party man, loth to leave the rejectionist Likud movement in which he was raised, whereas Mr Sharon, after deciding against the wishes of most of his fellow Likudniks to evacuate the Gaza Strip in 2005, simply set up a new party of his own. Mr Netanyahu remembers that his own coalition toppled him when he signed an agreement at Wye River in 1998 to withdraw from territory. In his own eyes he moved dangerously far four years ago, when, in a speech at Bar Ilan University, he flouted his party’s charter, which still promotes the vision of a Greater Israel, by embracing a two-state solution in principle.

In any event, if Mr Netanyahu is to begin negotiating in earnest, he still has a long way to go. A framework agreement would be only a stepping stone, albeit a big one, to a final settlement.

At a Likud parliamentary caucus on January 6th, he sought to quieten his restless flock by insisting Israel must keep the holy sites of Hebron, the West Bank’s largest city, along with strategic heights such as Beit Aryeh, overlooking Israel’s main airport, and low places such as the Jordan Valley. Of the settlement blocs that must stay within Israel after a border adjustment, he now also includes Beit El, deep in the West Bank, looming above Ramallah, the Palestinians’ current seat of government.

Mr Netanyahu moves only when cornered, says Aluf Benn, editor of Israel’s leading liberal newspaper, Haaretz. Mr Kerry has made it harder for Israel’s prime minister to say no by proposing that any Israeli withdrawal from the West Bank would be a slow process, to be completed long after Mr Netanyahu is likely to have left office: perhaps five years to prepare for a military withdrawal, ten for a final administrative handover to the Palestinians. American-led monitors will provide further guarantees, much as they have helped keep Egyptian and Israeli forces apart in the Sinai peninsula. Land swaps should ease the pain of withdrawing from the settlements, enabling Israel to retain the largest, such as Modiin Ilit, now home to 65,000 ultra-Orthodox Jews, whose high birth rate ups that number by 3,000 a year.

Israel is also being nudged along by the growing threats of an international boycott. Had its government not yielded when the EU insisted that Israeli institutions in the occupied West Bank would have to be excluded from certain joint research programmes, Israeli students might have lost their access to European universities, Tzipi Livni, Israel’s chief negotiator, recently told an audience at the Hebrew University.

A threatened right-wing Israeli backlash, by contrast, has so far looked relatively tame. An American framework based on the 1967 border between Israel and the West Bank might yet force Naftali Bennett, head of the Jewish Home, which has 12 seats in the Knesset and flatly rejects a Palestinian state, to leave the coalition. But Mr Bennett worries that if he did, Mr Netanyahu might be freer to lurch further left.

More worrying for Mr Netanyahu is the prospect that if Mr Bennett went, he might take most of the prime minister’s own Likud with him. Thanks to a huge influx of settlers into its ranks, they hold sway in choosing candidates for the party list. Junior Likudniks have begun trying to pass laws to prevent him from ceding territory.

Back in 1995 the settlers were saved—in the short run, anyway—by the assassin’s bullet that killed Yitzhak Rabin, when, as prime minister, he seemed determined to give the Palestinians a state. This time salvation could come from the Palestinians themselves. They complain that the goalposts are constantly shifting against them and that their sovereignty over the state being proposed is being whittled away. Many say the idea of a framework agreement is another ploy to drag the negotiations on for another year, giving Mr Netanyahu more time to bolster the settlements and then stick to the hated status quo.

Mr Kerry has refused to talk to the Palestinians’ main Islamist movement, Hamas, which still runs Gaza and dismisses the negotiations as worthless. But many in their more emollient and secular movement, led by Mahmoud Abbas, are scarcely less suspicious, and are instead honing plans to prosecute Israel in international courts and increase its isolation. It would be the ultimate irony if Mr Netanyahu were finally to persuade enough of his fellow right-wingers to embrace a two-state solution—only to see it rejected as inadequate even by the milder of the Palestinians.