Five years ago, Gaza's streets were decked out with maroon-and-white flags to welcome the emir of Qatar, Sheik Hamad bin Khalifa al Thani.
Celebratory songs played on the radio as Hamad made the first visit by a foreign head of state to the Hamas-run enclave and pledged $400 million for building projects — a diplomatic coup for the Palestinian militant group.
But in recent weeks, Qatari support has wavered as the tiny Persian Gulf emirate came under political and economic pressure from Arab neighbors to distance itself from Islamist groups in the region. Hamas leaders have been leaving their headquarters in Doha, Qatar's capital, and continued support for Qatari construction in the Gaza Strip looks uncertain.
Qatar's precarious situation has prompted Hamas — which is grappling with a power shortage in Gaza that deepened Monday — to seek to repair ties with Egypt. In recent talks in Cairo, Hamas and Egyptian officials have discussed cooperating to shut down the flow of arms and militants to armed groups in the Sinai Peninsula loyal to the militant group Islamic State.
"Regional circumstances have changed, Hamas is politically isolated more than ever," said Mkhaimar Abusada, a political science professor at Gaza's Al Azhar University. "There might be a window of opportunity to recommit with the Egyptians. That might give Hamas a chance to at least avoid further political isolation."
Closer ties with Egypt and an easing of Cairo's blockade might help restrain Hamas' hawkish military wing from escalating hostilities with Israel. Khalil Haya, the deputy Hamas chief, said Sunday that the group doesn't plan to embark on a new round of fighting with Israel – contradicting remarks from Hamas officials a week earlier.
Qatar became Hamas' most important patron following the turmoil of the Arab Spring uprisings that began in 2011. After Syria became engulfed in a civil war, Khaled Meshaal, Hamas' former political leader, decamped from Damascus and relocated to Doha. Qatar financed roads, hospitals and salaries in Gaza, as well as electricity purchases from Israel. Its Al Jazeera news channel provided sympathetic news coverage. Qatar's support for the 2 million Palestinians in the blockaded territory gave it added prestige within the Middle East.
But now, Qatar finds itself under siege. Many of its Arab neighbors have cut diplomatic ties, and Saudi Arabia has shut air, sea and land borders with Doha. And the pressure on Qatar is reverberating in Gaza.
After top Hamas officials left Doha, Haya said on Sunday that the group's newly elected political chief, Ismail Haniyeh, has abandoned plans to relocate from Gaza to Qatar. The diplomatic breach is also playing out in a half-finished new residential project in the southern Gaza Strip that is being financed by Qatar and is called "Hamad city" for the former Qatari leader. The fate of about 1,000 unbuilt homes is now uncertain.
Observers see Qatar and Hamas' current crises as stemming in part from the moves of the new U.S. administration in the region, as President Trump lumped Hamas together with Islamic State and other militant Islamist movements.
Hamas has also been under pressure from Palestinian Authority President Mahmoud Abbas, who cut funding for fuel payments for Gaza's sole power station as well as payments to Israel for Gaza's electricity bill.
On Monday, Mohammed Thabet, the spokesman of the Gaza Electricity Distribution Co., said that Israel had reduced the power it supplies to the enclave by about 7%. The power cut is expected to limit daily power supplies to residences to just three hours from the current allowance of five hours. Hamas officials warned last week that the electricity curtailment could lead to an "explosion" of violence.
"Hamas is grappling with an external crisis in the region and an internal crisis with the electricity," said Bjorn Brenner, a researcher at the Swedish Defense University and the author of a book on Hamas. "Hamas is super worried they will be completely kicked out of Qatar. If this happens they have to have a Plan B, and we don't know exactly what this involves."
Relations between Egypt and Hamas have historically been strained because of the Palestinian group's ties to the Muslim Brotherhood in Egypt. Following Egyptian President Abdel Fattah Sisi's ouster of the Muslim Brotherhood in 2013, relations between Cairo and Hamas – an offshoot of the Brotherhood – suffered.
Along with Israel, Egypt has enforced a blockade on Gaza by severely restricting Palestinians from crossing into Egypt. At the same time, Egyptian forces have been involved in a crackdown along the Gaza-Egypt border to block smuggling routes that aid militants in the Sinai Peninsula who are loyal to Islamic State.
Speaking to reporters on Sunday after a round of talks with Egypt, Haya sounded conciliatory toward Egypt and said that Cairo might step in to help alleviate the electricity crisis in Gaza.
"Relations with Egypt are going well and have improved," he said. "There is an Egyptian understanding of the crisis in Gaza and there was a readiness by Egypt to play an important role" in solving the crisis.
Haya said that Hamas is determined to block militant groups in Sinai that challenge Egyptian rule and that securing the borders is a "joint interest" with Cairo.
A rapprochement with Cairo is likely to be viewed with suspicion among some of Hamas' sympathizers in the Palestinian territories.
"The main objective of Saudi Arabia and Egypt is to pressure Hamas, since Qatar is the only country helping Hamas. They are trying to pressure Hamas to move toward a peace process with Israel," said Nashat Aqtash, a communications professor at Birzeit University in the West Bank who has worked as a consultant to Islamist candidates. "The Egyptian government is a servant of the Israelis, the U.S. and the Saudis."
A detente with Cairo would also limit the possibility that Hamas might seek to enhance its ties with Iran, a rival of Saudi Arabia and Egypt. A rekindling of Hamas' alliance with Iran — an option that has been pushed by the organization's military wing — would raise the risk of a new conflict with Israel.
"The situation contains the risk that Hamas, feeling pinched and squeezed, and perhaps pushed into Iran's arms, might become more militant," said Daniel Shapiro, a former U.S. ambassador to Israel, in a conference call with reporters. "There are lots of pressures and vectors on Hamas, some pushing them toward conflict, others that could prevent it."
Special correspondent Mitnick reported from Tel Aviv and Abualouf from Gaza City.