Palestinians are facing an existential crisis over the future of their struggle for independence, but this time the enemy isn’t just Israel. Instead, they’re fighting each other — and the clash has major stakes for one of the world’s longest-running, and most violent, political disputes.

That’s because the Palestinian leadership has for a full decade been divided by two competing factions: the Palestinian Authority, which runs the West Bank with the political and financial support of the US and other major foreign powers, and the Islamist extremist group Hamas, which runs the Gaza Strip. Their bitter power struggle was recently brought to a head, as strange as it sounds, by electricity bills.

Earlier this year, Palestinian President Mahmoud Abbas stopped paying Israel to supply Gaza with electricity. Abbas acts as the intermediary between Hamas (which doesn’t recognize Israel) and Israel (which controls Gaza’s power lines). In moving against Hamas, he indicated that he was done propping up the Palestinian Authority’s political rival. For good measure, he also slashed the salaries of thousands of Gazan employees working in his government.

Abbas went even further on Sunday, telling an Israeli politician that he was prepared to slash his government’s $1.5 billion of financial support to Hamas “by 100 percent” unless the group’s government in Gaza cooperated with the Palestinian Authority.”

The harsh rhetoric means that Abbas is taking a risky gamble, hoping these punitive measures would bring Hamas to its knees and force it to join a national unity government with the Palestinian Authority. But the plan backfired quickly and spectacularly. Hamas refused to give in, and let the coastal enclave sink into darkness. Gaza’s 2 million residents were forced to get used to 20-hour blackouts and scorching summer days without air conditioning. Its already decrepit infrastructure deteriorated so severely that sewage overflowed into the sea.

The Palestinian Authority-Hamas rift is one between secular nationalism and militant Islam, between peace negotiations and armed struggle in pursuit of the independent Palestinian state. It also highlights a broader and surprising shift. Palestinians have been fighting Israel for decades, with many hundreds of civilian casualties on both sides (Palestinians have generally paid a far heavier toll; a war between Israel and Hamas in 2008 to 2009 is estimated to have killed more than 1,400 Palestinians. On the Israeli side, 13 died).

Now the Palestinians are fighting each other. That means the Middle East’s next war may not be another flare-up between Israel and the Palestinians. It could be a civil war between the Palestinians themselves.

Meet the two sides in the Palestinian civil war

To understand why, it’s important to understand the background of Hamas, an acronym that means “zeal” in Arabic. Hundreds of Israeli citizens, including at least 36 American citizens, have been killed by Hamas attacks in crowded restaurants, buses, hotel lobbies, and cafes since 2001. Israel, the United States, and most of the West considers Hamas to be a terrorist organization.

In the Gaza Strip, Hamas is known as something else: the government. It swept to power in 2007, ousting Abbas’s government from the West Bank along the way. The group argues that Abbas has made a fatal mistake by trying to win a Palestinian state through negotiations. Instead, Hamas’s Islamists assert that only all-out conquest of Israel will put an end to the slow-burning status quo that has for years mired Gaza, the West Bank, and Israel in conflict.

But the crisis is as much about its leaders’ personas as it is their ideologies. The secular Palestinian Authority is led by the aging and uncharismatic Abbas, 82, who has been in power since 2005. He took control of the party following the 2004 death of the Palestinian nationalist movement’s founder, Yasser Arafat, who vacillated between peace negotiations and violent resistance to Israel, and left behind a political legacy of disarray.

On the other side of the divide is Hamas, led by a popular hardliner, 54-year-old Ismail Haniyeh, who asserts that a spiritual and territorial “liberation” will be possible only through a two-pronged strategy of violence and strict adherence to Islamic law (which has included deploying “modesty police” to beat unmarried Gazans seen socializing with members of the opposite sex or who fail to wear what Hamas deems to be modest clothing).

Unlike Abbas, Hamas does not recognize Israel. It asserts that “the Zionists” have existed on Palestinian land illegally occupied in 1948 and in 1967.

The Middle East’s next crisis could be a civil war between the Palestinians themselves

Mkhaimar Abusada, a political scientist at al-Azhar University in Gaza, explained that Hamas’s ideology resonates among a generation that saw the Palestinian Authority build gleaming and internationally funded new government buildings in the West Bank — enriching many of its own officials along the way — while failing to have much impact on the ground, where Israeli settlement building continues and peace talks have been stalled for years.

Palestinian pollsters have not been able to conduct reliable polls in the Gaza Strip, and Hamas has not allowed elections in Gaza in its decade of rule. But based on the hundreds of thousands of residents who sporadically rally in support of the group, Hamas is believed to retain a solid support base among some one-third of Gazans, said Abusada. Those include tens of thousands of Hamas government employees who are financially dependent on the party for their livelihood.

“These are the most ideological people, who don’t really care whether life is good or bad,” Abusada told me.

Hamas’s populist appeal has spiked again in recent weeks, following a bloody dispute at a Jerusalem site sacred to both Muslims and Jews. On July 14, Arab-Israeli gunmen used weapons concealed at the religious complex — known as the Holy Sanctuary by Muslims and as the Temple Mount by Jews — to kill two Israeli policemen.

After Israel placed metal detectors at the complex’s entrance in response to the shooting, Palestinians flooded the street in protest, and Haniyeh, the Hamas leader, hailed the “beginning of the defeat of the [Israeli] occupation over Jerusalem.” Abbas chimed in, saying that in the past weeks of Palestinian resistance, including the killing of three Israelis in a West Bank settlement, “everyone stood as one man.”

But since Israel removed the metal detectors last week, tensions have subsided, and with it the rare moment of unity between the Palestinian Authority and Hamas.

Hamas is winning the war, but Palestinians are paying a heavy price

In attempting to squeeze Hamas into submission, Abbas bet the group would capitulate in order to avoid a humanitarian disaster. But that has never been the case in Gaza, where Hamas has deliberately provoked devastating wars with its vastly more powerful enemy, Israel.

Since it took control in 2007, Hamas has waged three bloody wars with Israel that claimed thousands of civilian lives and ravaged much of the strip’s infrastructure — yet it has declared victory every time. Hamas has never fulfilled its promise to end Israel’s crippling blockade on the strip, but the group has trumpeted Gaza’s “steadfastness” in the face of Israel’s military efforts to eradicate it.

After the 2014 war, Hamas officials excoriated Israel’s ruthless bombing of civilian areas and celebrated the thousands of Palestinian “martyrs” caught in the crossfires, telling families that their relatives would be rewarded for their sacrifice in heaven.

And if Hamas has its way, there may be more Palestinian, and Israeli, civilian casualties.

Hamas has long prided itself in its ability to use low-tech fighting tactics in the face of Israel’s high-tech military. When Israel and Egypt blockaded the enclave in 2007, Hamas pivoted from ground to air, and sent rockets into Israeli territory. When, in 2011, Israel deployed the Iron Dome defense system to intercept those rockets, Hamas shifted its efforts underground, into tunnels, snaking underneath the sandy Gazan terrain into Israel, which it’s threatened to use to send Hamas militants into Israel, to kill or kidnap Israeli soldiers.

After Israel destroyed 32 such tunnels in its 2014 war against Gaza, Hamas has frequently proclaimed in public that it has restored the lost tunnels, and is building many more.

“In any future confrontation, Israelis will be surprised by the strength and solidity of these tunnels, which can withstand Israeli shelling and bombs fired by the Israeli aircraft or tanks,” Hamas’s military leader, known as Abu Hamza, boasted in an interview last year.

Likewise, in the recent power controversy, Hamas has defiantly dug in when challenged by Abbas, using Abbas’s own party’s internal disunity against him.

“We would be all counting the days until the next war”

Hamas’s hardline Gaza chief, Yehiya Sinwar, forged an unlikely alliance with Mohammed Dahlan, a former senior official in the Palestinian Authority, before falling out of Abbas’s favor in 2010.

“We have made mutual efforts with our brothers in Hamas to restore hope for Gaza's heroic people,” Dahlan said in a videotaped speech in late July to a Hamas political meeting, his first public appearance alongside the armed group.

Hamas also struck a deal with Egypt, the country that has, alongside Israel, been enforcing a crippling land, sea, and air blockade on the Gaza Strip for most of the past decade. In June, Egypt sent tanker trucks loaded with diesel across the Sinai border into Gaza to provide a temporary trickle of relief.

On August 14, Egypt temporarily opened the Rafah checkpoint along the Egyptian-Gazan so that more than 1,000 Gazans could make their way to the hajj Islamic pilgrimage to Mecca, Saudi Arabia.

Egypt may open the crossing more regularly in coming months. If that happens, it would provide a legal avenue for imports and an alternative to the intricate network of tunnels currently used by smugglers with the de facto consent of the Hamas government. It would also be an enormous victory for the armed group, allowing it to fulfill a years-old promise to alleviate the trade and travel restrictions that have plunged the strip into its current desperate living conditions.

Palestinians are fighting Palestinians in a war for hearts and minds

That Hamas has managed to survive Abbas’s onslaught is seen by many Palestinians as a testament to its political acumen. It also fits into the group’s narrative: that while Abbas and his cronies are pushing paper and cooperating with Israel, Hamas has been doing the dirty work — gearing up for war, dispatching suicide bombers, and lobbing rockets into Israel — in the name of the Palestinian people.

But Hamas’s street cred is based on more than just rhetoric. Over the years, Hamas has said that its use of violence has succeeded in bringing Israel to the negotiating table. Abbas, on the other hand, has little to show after years of issuing statements about peace and shaking hands with his Israeli counterparts.

In the summer of 2014, it was Hamas, with the help of Egypt but not Abbas, that negotiated with Israel to end a brutal a 50-day war. In 2011, Hamas exchanged a captured Israeli soldier, Gilad Shalit, for more than 1,000 Palestinian prisoners, many of whom were serving life sentences for killing Israelis. Among them was Hamas’s current chief in Gaza, Yehiya Sinwar. Hamas rightly anticipated that the move would be lauded across Palestinian political society, where prisoners in Israeli jails are lionized.

Hamas’s sustained rule on the strip ironically supports its primary enemy, Israel, which has long insisted that Abbas cannot be a partner for peace because he has no sway over the Gaza Strip.

That leaves Abbas stuck uncomfortably between Hamas and Israel. He’s threatened to end security cooperations with Israel, but Israel barely dignifies such statements with a response. That’s because Abbas needs Israel’s security backing, and its American funders, to prevent Hamas from challenging Abbas’s rule in the West Bank.

More fundamentally, Abbas’s Palestinian Authority receives more than one-third of its $4 billion annual budget from foreign donors. (Republicans in Congress are talking openly about reducing or eliminating US aid to Abbas.)

The Palestinian internal crisis has been raging for years, but Trump could make a bad situation worse

Many Palestinians associate Abbas’s cooperation with Israel with the more than 350,000 Israeli settlers who live in the West Bank alongside 2.5 million Palestinian residents. The Israeli communities — distinguished by their red roofs and access to Israeli-supplied water pipelines and Israeli-only highways — are a stinging reminder to the Palestinians that Israeli military rule over the West Bank is creeping toward permanence with every passing year.

Indeed, most Palestinians say they no longer even support a Palestinian state and want Abbas to resign. They note that Israeli Prime Minister Benjamin Netanyahu’s hardline government has taken the once-fringe idea that Israel should annex all or part of the West Bank — the same land Palestinians envision as their future state — into the mainstream.

Israel, for its part, has long agreed with the Palestinian street: that Abbas is a feeble and ineffectual leader whose promises in the negotiation room could never actually influence anything on the ground. Many Israelis, like Palestinians, have long ago lost faith in the peace process after decades of wars, and instead are resigned to the uncomfortable, but sustainable, status quo.

But as the Israeli government and public remains static, far-right Israeli settlers in the West Bank are gearing up for what they say is the next phase: a one-state solution, in which all of the West Bank would be considered part of Israel. Palestinians would need to either “prove their loyalty” to Israel or leave, Avihai Boaron, a settler activist, told me.

“The dangerous lie of the Palestinian state is finally coming to an end, and Abbas’s failure makes official what we’ve already known for years: that there is no reality in which Jews and Arabs can live side by side,” he said.

Boaron isn’t an uninterested observer: Earlier this year, he was evacuated from the West Bank settlement of Amona after Israeli courts declared that it had been built on private Palestinian land.

“With Trump, who doesn’t have much patience for the ‘politically correct,’ I think Israel’s government is ready to let go of this lie of [an independent] Palestine,” he said.

Trump’s new peace push could make a bad situation worse

The Palestinian internal crisis has stretched for over a decade, but experts say that a political wild card, President Donald Trump, has stoked an already tense situation.

Trump’s proclamations that he’d go after the “ultimate deal” between Israelis and Palestinians originally sparked optimism in the Palestinian Authority. In the past eight years under Barack Obama, they’ve seen the Palestinian cause sidelined by the Syrian conflict, and seen America retreat from the region. For the first time in a decade, Abbas’s team granted cheerful interviews with the American press, saying that they were optimistic that Trump would fulfill his promise to be “a neutral guy” in Israeli-Palestinian negotiations.

After Abbas visited the White House on May 3, he announced that the conversation had “left him hopeful.” In a joint press conference with Trump he said that he believed the US president’s “courageous stewardship,” “wisdom,” and “great negotiation abilities,” would “bring about a historic peace treaty.”

Following the White House meeting, the Palestinian ambassador to Washington, Husam Zomlot, told Politico that “all indications are that President Trump is serious and keen regarding starting a political process, and so are we.”

Hamas, too, has been eager to get its name in the game. A day before Abbas met Trump in Washington, Hamas published a new, moderately worded document of principles (leaving out the parts about Jewish world domination and the comparisons between Jews and Nazis) in an attempt to rebrand the group.

It indicated that it would consider aligning with the Palestinian Authority for a (provisional) Palestinian state along the 1967 lines — the territories captured by Israel in the 1967 Six-Day War, including East Jerusalem, the West Bank, and Gaza. But it did not relinquish its right to violence or to regaining all of “historic Palestine,” meaning the land on which Israel stands.

“The document gives us a chance to connect with the outside world,” Fawzi Barhoum, a Hamas spokesperson, told reporters in Qatar in May, in an unsubtle nod to the new American president. “To the world, our message is: Hamas is not radical. We are a pragmatic and civilized movement. We do not hate the Jews. We only fight who occupies our lands and kills our people.”

Hamas has much to gain in allying itself with the US — namely securing long-desired international standing, and funding, that would bolster its claim that Hamas (not Abbas’s the Palestinian Authority) is the real representative of the Palestinian people.

International support would also help Hamas squash its own internal, more radical rivals inside Gaza, which include Islamic Jihad, an even more extremist Islamist group, and various other militant groups. The biggest long-term threat may come from the Islamic State, which has been steadily building up its presence in the Gaza Strip. In June, the group claimed responsibility for stabbing an Israeli policewoman to death near Jerusalem’s Old City — the first time ISIS had carried out a lethal attack within Israel proper.

ISIS hasn’t stopped there. On August 17, a suicide bomber identified by Hamas as an ISIS member killed a Hamas militant in southern Gaza, the first such attack against a member of Hamas there.

The Hamas decision to pivot toward the US is a Hail Mary of sorts as its external challenges continue to grow: the armed group’s main backer, Qatar, recently cut back on its aid to Gaza after Saudi Arabia and its Gulf allies imposed a severe economic and diplomatic blockade against Qatar — in part because of its support for Hamas.

But Hamas faces an uphill battle, having marketed itself for years as the only Palestinian party with the spine to stand up against Israel and the international community. “US and Israeli say no to Hamas. What do you say?” read one of its 2006 campaign slogans. In Trump’s first trip abroad as president in May, Abbas was one of the leaders from 55 Muslim countries whom the Saudis invited to attend Trump’s Islam speech in the Saudi capital of Riyadh and meet with the new president. Hamas was not invited.

For his part, Trump seems to have made no apparent progress on the Israeli-Palestinian front. He’s tasked his son-in-law and senior adviser Jared Kushner, a 36-year-old real estate developer with no political or diplomatic experience, with brokering a peace deal between the Israelis and Palestinians.

And so far, Kushner seems to be in over his head. When asked in a recent off-the-record interview with congressional interns how the Trump administration’s approach to peace is unique, Kushner responded, “I don’t know,” according to a leaked transcript.

The next Mideast war may be drawing closer by the day

Perhaps the ultimate irony of Abbas’s quest to squeeze Hamas into submission is that it actually could have worked — if it were 2007, the year that Hamas took control of the strip, and before it was entrenched into the territory. Now, the only impact of the move is making life more miserable for Gazans, most of whom are critical of the Hamas regime.

The strip’s already resource-strapped health care system has scrambled to care for an overload of sick patients, many of whom have been denied by Hamas to seek medical treatment outside of the besieged strip.

Mohammed Nijim, a resident of Gaza City, told me that his ailing father, who has been trying for four months to obtain a medical travel visa for treatment in Ramallah or Israel, is being played as a pawn by all political groups with a hand in Gaza: Hamas, the Palestinian Authority, Israel, and the assorted regional players.

Last month, Nijim wrote of his father on Facebook: “This is a man who belongs to no political faction and receives no income from the conflicts that have submerged us into the depths of this earthly hell. … Know that if you prevented us from receiving treatment, water, or electricity, we will hang you.”

Experts warn that as the humanitarian toll mounts, the Palestinian Authority-Hamas split could effectively lead to the creation of two separate Palestinian states: one run by Hamas, which does not recognize Israel, and the other run by the Palestinian Authority, which does but has failed to strike a peace deal with the Jewish state. Such a change would further isolate Hamas, and make it all the more desperate to maintain its own perceived legitimacy among Gazans by violently lashing out at Israel.

In other words, it’s the kind of literal divide would that bring the prospect of the next war with Israel that much closer.

“Difficult conditions put a lot of pressure on Hamas to deliver,” Ramallah-based Palestinian pollster Khalil Shikaki told me. “One way to divert attention would be for Hamas to say that Abbas and the Israelis are conspiring against Gaza. In that case, we would be all counting the days until the next war.”

Shira Rubin is a journalist based in Tel Aviv, where she covers Israel, Palestine, and the region. She also writes for the Atlantic, USA Today, the Daily Beast and the Los Angeles Times. Follow her on Twitter @shira_rubin.