CAIRO — In the Gaza war now in its third bloody week, Hamas' battle isn't only with Israel, even though that's the country it is firing rockets at. The militant group that rules Gaza is demanding Egypt open its border with the tiny, blockaded strip of territory.
Even as it presents itself as a mediator in the conflict, Egypt is taking a hard line, refusing any opening that would strengthen Hamas, a group it accuses of fueling militancy on its soil.
And so far, despite the Israeli military's killing of Palestinians, the Egyptian public has largely gone along.
As civilian casualties rise in Gaza, Egypt's government runs the risk that Egyptians will blame it for not making concessions that could stop the bloodshed.
Still, authorities in Cairo have insisted they won't bend. Foreign Minister Sameh Shukri called Rafah a "red line," warning against pressuring Egypt on the issue.
Both Israel and Egypt have enforced a crippling, years-long blockade of Gaza. Israel also faces demands to open its crossings, which are vital to reviving the strip's economy, but it is likely to resist doing so.
For its part, Egypt has made it clear it won't open the border unless the Gaza side is run by Hamas' rival, President Mahmoud Abbas' Palestinian Authority.
The Palestinian Authority was ejected from Gaza when the militant group took over the territory in 2007. Hamas has been reluctant to let Abbas loyalists back in control.
For the moment, Egypt's government is insulated from a backlash at home by the fierce anti-Islamist sentiment in the country since last year's ouster of Islamist President Mohammed Morsi by the then-military chief, now Egypt's president, Abdel-Fattah el-Sissi.
Over the past year, authorities have fanned public anger not only against the Muslim Brotherhood but also against its ally, Hamas, depicting it as a threat.
Egyptians' fears have been increased by a wave of Islamic militant bombings and shootings in the past year, which the government accuses Hamas of helping by sending weapons through tunnels under the border. Hamas denies that.
For months, the Egyptian military has been working to destroy the tunnels.
The vilification of Hamas in Egypt has only increased since the Gaza war erupted.
Egyptian TV stations and newspapers — which are overwhelmingly pro-government — have issued a stream of commentary that sounds a lot like what is coming out of Israel: Hamas is to blame for the fighting and is exploiting Palestinian civilian deaths for its own gain.
The vehemence has at times been startling.
"Let Gaza burn with those in it," proclaimed Tawfik Okasha, a pro-military TV presenter known for his rabid anti-Islamist rhetoric. He praised Israel's leadership — "You are men," he said — for striking back against Hamas after the kidnapping and killing of three Israelis last month.
Another presenter, Amany el-Khayat, accused Hamas of trying to promote its "resistance" image by letting Gazan civilians die, saying the group seeks to "wash its face ... with Palestinians' blood."
On Wednesday, in his first public comments on the Gaza crisis, Egypt's president did not even issue the usual Egyptian condemnation of Israeli "aggression."
In past Israel-Hamas violence, Egypt's government faced embarrassing public calls to open its Rafah crossing with Gaza, with critics accusing it of helping Israel.
This time, however, criticism has been muted, and there have hardly been any street rallies in support of Gazans. Anti-Islamist sentiment may not be the only reason; Egypt imposed a draconian anti-protest law last year.
One attempt by Egyptian activists to go in a convoy to Gaza to deliver humanitarian aid was blocked by Egyptian security. But a second activist convoy was allowed in on Friday.
Egypt has stepped in as a mediator in the conflict, presenting a proposal that called for an unconditional cease-fire, followed by Egypt-mediated talks. Israel accepted the proposal, but Hamas rejected it, insisting on guarantees up front that its demands will be met.
Hamas chief Khaled Mashaal, in a speech Wednesday, demanded the immediate opening of Gaza borders "held by Arabs" — a clear reference to Egypt.
For Egyptian authorities, an unconditional opening of Rafah would only serve to strengthen Hamas' rule.
"The whole issue here is that Hamas wants to be recognized as the legitimate ruler of Gaza Strip," Samir Ghattas, head of the Maqdis Center for Strategic Studies in Cairo. "Egypt will not agree on this and will not permit the establishment of a Brotherhood state on its eastern borders."