TIME was when Egypt balked at involvement in Gaza. In 2005, when Israel withdrew soldiers and settlers, Egypt fretted that it would become responsible for the territory, which it saw as a liability. More recently, the enclave’s rule by Hamas, a Palestinian offshoot of Egypt’s own Islamist bugbear, the Muslim Brotherhood, made engagement toxic. Egypt has even matched Israel’s restrictions on the flow of goods and people across Gaza’s frontiers, destroying smuggling tunnels and leaving the enclave under a gruelling siege.

It is strange, then, that Egypt is now riding to Gaza’s rescue. It is revamping the border crossing at Rafah and easing the restrictions. Palestinian pilgrims bound for Mecca crossed into Egypt last week, along with a Hamas delegation. Fuel is flowing the other way and more electricity is promised. Stranger still is that Hamas is also working with the United Arab Emirates (UAE), which is vehemently anti-Islamist and, along with Egypt, regards the Brotherhood as a terrorist organisation.

The UAE, it seems, wants to increase its influence in Gaza, at the expense of Qatar, which has been isolated by several Arab countries, in part, over its backing of Islamists. Hamas said in May that it would end its association with the Brotherhood. It has also attended talks in Egypt with the UAE’s favourite Palestinian, Muhammad Dahlan. As a former security chief in Palestine, Mr Dahlan tormented Hamas, calling it “a bunch of murderers and thieves”. After Hamas won an election in 2006, he tried to bring down the government in Gaza. Eventually Hamas chased him out in 2007. “In politics, nothing is permanent,” explains a representative of the group in Cairo.