ISRAEL has diplomatic relations with only three nearby countries. In the space of ten days its ambassadors have been humiliatingly forced out of two of them: Turkey and Egypt. The king of the third, Jordan's Abdullah, commented without apparent displeasure that Israel was “scared”.

A week after the Turkish démarche, and linked to it in the eyes of many Israeli commentators, a Cairo mob attacked the Israeli embassy, housed on three floors of a high-rise building in the suburb of Giza. Policemen did little as demonstrators with hammers battered down a wall of concrete slabs put in place to protect the building. The embassy had recently been menaced by protesters in the wake of an incident along Egypt's border with Israel in Sinai, when several Egyptian soldiers were killed, apparently by Israeli troops engaged in a battle with Palestinian fighters.

Even more troubling for Israel, Field-Marshal Muhammad Tantawi, Egypt's top man for the time being, and others in Egypt's interim military government were unavailable to take calls from Israel's prime minister, Binyamin Netanyahu, until Barack Obama intervened directly with them. Six Israeli security men stuck in the embassy were eventually rescued by Egyptian commandos who scattered the crowd with gunfire. Some 80 Israeli diplomats and their families were driven to the airport under military escort and ferried home by an Israeli air-force plane.

Mr Netanyahu says his ambassador will soon be back. Egyptian officials have voiced embarrassed regret. But even if Israel can find and fortify an alternative less vulnerable location, it sees the episode, with its display of deep antipathy towards Israel on the Egyptian street and the perhaps deliberately slow reaction of the Egyptian authorities, as ominous. And it looked on grimly as Recep Tayyip Erdogan, Turkey's prime minister, flying into Cairo on September 12th, was feted as a champion of the Palestinian and Muslim cause.

Mr Netanyahu speaks almost fatalistically of the ferment in the region. His aides bemoan Mr Erdogan's ambitions of regional leadership. They seem to have concluded, however, that they should be as reluctant as ever to give any ground to the Palestinians. In particular, Mr Netanyahu and his friends in the pro-Israel lobby in the United States are inveighing vehemently, albeit with an undertone of panic, against the campaign by the Palestinians to win a vote in the UN later this month to grant them statehood, at least on paper. Most wretched, from Israel's point of view, is the possibility of an emerging consensus among Europeans on the Palestine vote at the UN; they may offer the Palestinians some kind of statehood (“the Vatican option” is a widely touted compromise), albeit without full membership at this stage.

At street level, many Egyptians were delighted by the assault on the embassy. Last month a young man called Ahmed al-Shahat, dubbed “the flagman”, was hailed as a national hero for scaling the Israeli building and replacing the Star of David with a Palestinian banner. But reaction to the burning of the building on September 9th was more nuanced. Most prominent political groups, from the left-liberal April 6th Movement to the Islamist Muslim Brotherhood and even the more extreme Salafists, condemned the violence, though the Islamists were evasive about the entry into the building. And the interim military government took advantage of the assault to threaten a crackdown against street protesters continuing to call for faster reform.

Yet Egyptian attitudes to Israel are rarely simple. A bit of anti-Israeli theatre goes down well. But when incidents such as the embassy break-in become an international affair and foreign governments question Egypt's ability to protect diplomats, whoever they may be, people become edgier. Opinion polls suggest Egyptians want peace with Israel but not necessarily under the terms of the 1979 treaty.

All the same, anti-Israeli feeling is growing. Some political parties want to close the Suez Canal to the Israeli navy and to block the sale of natural gas to Israel. The new Freedom and Justice Party, an offshoot of the Muslim Brotherhood, says the 1979 treaty should be “revised”.

But most groups dread the prospect of actual war. One of the few good things that many Egyptians have to say of Hosni Mubarak, their deposed and generally reviled president, is that he kept Egypt out of war with Israel. The military government says that policy towards Israel should be left to an elected government. Still, the embassy incident serves as a warning to Israel that a democratically elected Egyptian government may be a lot less friendly.