President Abdel Fattah el-Sisi of Egypt woke up on Oct. 7 remarkably unpopular for someone considered a shoo-in for a third term in office — guaranteed by his authoritarian grip on the country to dominate elections that begin on Sunday, but badly damaged by a slow-motion economic collapse.
The ensuing weeks have eclipsed all of that, with war displacing financial worries as the top item on many Egyptians’ minds, lips and social media feeds. For Western partners and Persian Gulf backers, the crisis has also highlighted Egypt’s vital role as a conduit for humanitarian aid to Gaza and a mediator between Israel and Hamas, the armed Palestinian group that led the attack on Israel on Oct. 7 and set off the war.
Mr. el-Sisi, a former general with a knack for outlasting setbacks, appeared to have caught yet another break, one that has allowed him to position himself as a champion of the Palestinian cause at home and an indispensable regional leader abroad.
In Cairo these days, a widespread boycott of Western companies associated with support for Israel has transformed the simple act of serving a Pepsi into a serious faux pas. Egyptians struggling to cover the basics after nearly two years of record-setting inflation have opened their wallets to help victims of the Gaza war.
And in a country where protests have been banned for years, hundreds of people have braved arrest to march in solidarity with the Palestinians.
The three-day presidential vote starting on Sunday is expected to rubber-stamp Mr. el-Sisi’s hold for another six-year term: None of his three challengers stand a chance of unseating him.
Nevertheless, the president will need to steer carefully, analysts and diplomats said. The economic crisis that had punctured Mr. el-Sisi’s aura of invulnerability is still bleeding households, companies and the nation’s finances. Gaza or no Gaza, Egypt is expected to devalue its currency after the election, promising further pain for its people.
And with public support for the Palestinians at a high, Egyptians are alert to any sign that their government may be complicit in the suffering in Gaza, whether by acceding to Israeli restrictions on the aid flowing from Egypt into the territory or proposals to move Gazans into Egypt in exchange for aid — an idea that is widely opposed across the Arab world.
“The government definitely doesn’t want to test the patience of the Egyptian people, not when it comes to Palestine,” said Hesham Sallam, a scholar of Arab politics at Stanford’s Center on Democracy, Development and the Rule of Law.
Like many in Cairo these days, Aya Khalil, 34, a private art teacher, said she no longer buys anything before checking its provenance against online lists of Western brands blacklisted for their support for Israel.
“Me boycotting these brands is just a drop in the ocean, but I’m doing the only thing I can do,” she said.
Like many other Egyptians, she questioned whether the government was doing enough to pump aid into Gaza. Egypt blames Israel for limiting the aid, but calls to end the 16-year-old joint Israeli-Egyptian blockade of Gaza and for Egypt to stop giving Israel any say over Egypt’s border crossing with Gaza have grown in recent weeks.
Yet Egypt cannot afford to alienate Israel, with which it has developed a strong, if hush-hush, security partnership in the Sinai Peninsula, or to agitate Western backers, particularly when it needs all the financial support it can get.
Many Egyptians despair of the dire economic picture and borrow month after month just to pay for the basics. Sugar recently doubled in price in some places, and inflation, already running above 35 percent annually, is expected to worsen if the government devalues the currency.
Before Hamas’s attack on Israel, signs of Mr. el-Sisi’s growing unpopularity were unmistakable.
An upstart challenger, Ahmed al-Tantawy, was drawing support around Egypt with criticisms of the president that few others here had dared voice since he began throttling dissent in recent years. Activists and liberals spoke expectantly of Mr. el-Sisi’s eventual downfall. Sensing strength in numbers, many Egyptians no longer bothered to lower their voices before trashing their president.
Abroad, the International Monetary Fund and wealthy gulf benefactors had grown impatient waiting for Egypt to make good on its promises of economic reform, and no calculator could figure how the country would avoid defaulting on its $165 billion in foreign debts.
Washington was in an uproar over accusations that Egypt had bribed a senior U.S. senator in return for official favors and sensitive information, causing Congress to block an extra $235 million in military aid for the Sisi government.
Within days of Israel’s assault on Gaza in retaliation for the Oct. 7 attacks, however, Mr. el-Sisi’s wobble appeared to have steadied.
“With every war that comes, it’s a good chance for him to make it his excuse for the economic crisis,” said Salah Ali, an engineer from the southern city of Aswan employed to build what is supposed to be the president’s marquee legacy project, a costly new capital city that has helped swell Egypt’s debt.
“What do you mean, ‘elections’?” he added, sarcastically, echoing a widespread belief that the outcome is predetermined, despite assertions from a government spokesman, Diaa Rashwan, that the vote shows Egypt to be on an “earnest path toward genuine political pluralism.”
The one Sisi challenger who had generated some momentum, Mr. al-Tantawy, was pushed out of the presidential race after government agents violently prevented his supporters from registering enough endorsements to put him on the ballot just before the war erupted, his campaign said, a headline quickly buried by the avalanche of news from Gaza. On trial for what rights group call trumped-up charges, he has said 137 members of his campaign have been detained.
The three other men who did wind up on the ballot are little known. Even the one with some opposition support has refrained from all but the mildest critiques of the president, perhaps fearing the fate of independent-minded candidates in the 2018 election, when all serious challengers to Mr. el-Sisi were arrested.
Analysts say Egypt is dragging its feet over meeting the conditions of the $3 billion I.M.F. bailout granted last year. But the fund’s director, Kristalina Georgieva, has said that the I.M.F. is “very likely” to bolster the amount of the loan anyway in light of the war.
The European Union, fearing another migration crisis, is likewise accelerating some $10 billion in funding for Egypt.
And liberal activists, Sisi supporters and many people in between have found themselves in a rare moment of unity, condemning Israel’s siege and bombardment of Gaza and rejecting the idea of Gazans’ being forced into Egypt’s Sinai Peninsula, which borders the territory.
Many fear such displacement would mean the Palestinians would lose their own land forever and bring Hamas into a historically and emotionally charged part of Egypt, eventually drawing Egypt into a war with Israel.
Mr. el-Sisi was quick to read the room.
“The aim of the stifling blockade on the strip, of cutting water and power and preventing the entry of aid, is to push the Palestinians toward Egypt,” Mr. el-Sisi said in a joint news conference with the German chancellor on Oct. 18, one of several times he has made clear that the answer is no.
“We reject the liquidation of the Palestinian cause and the forced displacement in Sinai.”
But Mr. el-Sisi was also strategically harnessing Egyptians’ fury and grief over the war, analysts and diplomats say.
On Oct. 20, groups close to the government organized a day of nationwide pro-Palestinian demonstrations that the government said drew hundreds of thousands of people, a figure that could not be independently verified.
Extensively covered on state media, the rallies were festooned with banners that included Mr. el-Sisi’s photo next to images of Jerusalem’s Al-Aqsa Mosque — a less-than-subtle attempt to yoke the Palestinian cause to Mr. el-Sisi’s.
“Without Sisi, we’d be doomed,” said Reda Saad, 42, an employee at Egypt’s state-owned gas company who had brought her four children to one rally, when asked how she rated his handling of the crisis.
She said she was “still angry” about Egypt’s economic meltdown but had put that aside in the face of Gaza’s suffering.
“That’s one thing,” she said, “and this is another.”
But dozens of people were arrested in separate marches the same day in which demonstrators chanted anti-Sisi slogans, making clear that government attempts to channel pro-Palestinian passions risk churning up…