IN THE vanguard of the Islamist surge across the region a few years ago, Gaza’s Islamists now feel like the last men standing. Trapped between the Mediterranean sea and the walls of two hostile neighbours, Egypt and Israel, they wonder how long they, too, can survive. “It’s hopeless,” cries a senior man from Hamas, the Palestinians’ Islamist movement. “We tried democracy and we failed. We tried to reach out to the Israelis, accepting two states, and failed. We tried the armed struggle, and we paid the price.”

In olden times a crossroads between Africa and Asia, the tiny enclave of Gaza has rarely felt more isolated. Egypt’s generals, who took power last summer, have destroyed 90% of the tunnels through which Gaza got its fuel, shrouding the place in darkness. Mothers wake at midnight when the electricity briefly flickers on, to flush toilets and iron clothes. Lifts in high-rise buildings do not work. Sewage flows untreated. Farmers, unable to irrigate their fields, face ruin. “I should never have tried it,” says the owner of a hotel that opened last summer, overlooking Gaza’s picturesque port. Paying for his generators costs him more than he earns in a night.

Much of the mess is of Hamas’s own making. Carried away by the Arab awakening, its politburo abandoned its old patrons in Syria and Iran and rushed to embrace the Islamists who had taken power in Egypt. But the fall of its president, Muhammad Morsi, has left Hamas friendless. It has been kept out of the current negotiations, under America’s aegis, between Palestine and Israel. The only time the world seems to notice Gaza is when violence erupts. Gazans say they have dropped off the map.

This suits most Israelis. “The past year was a great one,” says the commander of Israel’s division that watches Gaza, Brigadier Michael Edelstein, celebrating the ceasefire that Israel agreed on with Hamas a year ago. Missiles lobbed at Israel from Gaza have fallen from 1,500 last year to about 50 so far this year, he says. Thanks to Hamas forces guarding the frontier against militants, he adds, children in Israel’s border towns can sleep in their beds, not in shelters, and no longer go to school in armoured buses.

But Israel’s reciprocal promise to help revive Gaza’s economy has not been kept. Egypt’s closure of the tunnels and its border crossing at Rafah has left Gaza’s 1.8m people dependent on Israel. Food is allowed in but not—for example—solar panels, which could provide Gazans with an independent source of electricity. Israel stops most Gazan goods from being exported. Last month it joined Egypt in preventing building material from being brought in, because Hamas’s military arm, it says, uses such supplies for building fortifications—and for digging tunnels, like a recently discovered one that stretched 200 yards into Israel. Cement prices have quadrupled in the past few months and tens of thousands of labourers have lost work. Collective punishment, say the Gazans.

Bereft of tunnel revenues, the Hamas government is nearly bankrupt. Gaza’s 40,000 public workers have been on half-pay since the summer. A growing number of Gazans want Hamas chucked out of power. Mahmoud Abbas, Palestine’s anti-Islamist president, based in the West Bank, has spurned Hamas’s offer to form a joint government mainly of his choosing.

Instead, he is cosying up to General Abdel Fatah al-Sisi, Egypt’s new strongman. Mr Abbas has offered to arrange for Gaza to be supplied with fuel if Hamas pays tax to the Palestinian Authority, which he runs. Hamas suspects that Mr Abbas’s people are planning to overthrow it, much as General Sisi got rid of Mr Morsi in July. Some say the Egyptians are grooming Muhammad Dahlan, Mr Abbas’s former strongman in Gaza, for a comeback.

But Hamas has no intention of going quietly. “Unlike the Muslim Brotherhood, we will not be good victims,” says Basim Naim, a senior Hamas official. As the risk of confrontation grows, Hamas’s military men are returning to the fore. Ismail Haniyeh, Gaza’s Hamas prime minister, normally a mellifluous speaker, has begun to read from prepared speeches. And Hamas is acting with renewed harshness towards dissent, especially against “Tamarod” (“Revolt”), a nebulous group echoing Egypt’s anti-Islamist movement of the same name. Gaza’s Tamarod used social media to call for an uprising on November 11th, the anniversary of the death of Yasser Arafat, the Palestinians’ longtime leader. But Hamas banned any such commemoration and threatened to shoot protesters on sight. In the event, the streets were quiet.

Brigadier Edelstein worries about Gaza’s mounting mood of insecurity. “Sometimes, when your enemy is weak, it is dangerous,” he says. Should Hamas totter, he warns, Gaza could again become a free-for-all for extreme militants. “Find an accommodation with Israel,” said Eyad Serraj, a respected but ailing Gazan human-rights campaigner, when Mr Haniyeh visited him for advice. Others suggest that Turkey and Qatar, Hamas’s last regional backers, could seek to send aid through Israel, paving the way for improved ties between all four. But such a rapprochement seems unlikely at present. In the meantime, Gaza is rotting away.