Sarah Lynch

Special for USA TODAY

CAIRO — An echo of the anti-Hamas rhetoric coming from Israel during its conflict with Gaza is resonating from what many would consider a surprising corner since fighting erupted July 8: Egypt.

A country whose leader just over a year ago had been a close Hamas ally is now one of its principal antagonists. It is stirring up public opinion against the militant group because Hamas is the Palestinian branch of the Muslim Brotherhood, which Egypt has outlawed.

Normally, Egyptians would be decrying Israel for the Palestinian death toll in Gaza, which is at more than 750 and rising. But Abou Ahmed Shehab, 60, who sells scarves at a sidewalk stand in central Cairo, was quick to attack Hamas.

"The reason for what's happening to our Palestinian brothers is because of Hamas," he says. "Hamas is an extremist group."

Last summer, the Egyptian military ousted Muslim Brotherhood leader Mohammed Morsi as president and jailed him. It branded the Islamist group a terrorist organization and threw thousands of its leaders and members in jail. Hundreds were killed as the Islamic movement became the focus of a security crackdown.

Since then, a military-backed government that is now led by Abdel Fattah al-Sisi, who went from military strongman to elected president this past spring, has succeeded in stoking anti-Islamist sentiment among a large swathe of Egypt's public. Both state-run and privately owned media have helped fuel the anti-Hamas attitudes.

Hamas has "terrible policies and the outcomes of those policies are being felt by women and children," said taxi driver Medhat Kamel, 40, about civilian deaths in Gaza. "They rely on violence and don't use dialogue."

From a political standpoint, Hamas is criticized in Egypt for its "unwise ways" of managing the crisis with Israel, said Mustapha Al Sayyid, a political science professor at both Cairo University and the American University in Cairo. Last week, Hamas rejected an Egyptian cease-fire initiative, saying it wasn't consulted and the proposal wouldn't end an Israeli and Egyptian blockade of Hamas-ruled Gaza, which is suffering economically as a result.

Egypt's hostility toward Gaza may be one reason Hamas lamented last week that it feels "alone" in battling Israel without support from the Arab region.

Today's situation is different from 2012, the last conflict between Israel and Hamas. At the time, Morsi brokered a cease-fire that Hamas accepted.

Two years later, the Egyptian government, which has accused Hamas of helping militants attack soldiers and police in Egypt, is doing little to help the Palestinians. It's keeping its Rafah border crossing with Gaza closed, even preventing a humanitarian aid convoy from crossing.

Khaled Fahmy, chair of the history department at the American University in Cairo, has observed a sea change in public discussion about Hamas recently.

"There has been an alarming outpouring in the past two weeks, not only dumbing down and toning down criticism of Israel, but also — in fact — a very, very sharp increase in vitriolic, racist discourse against Palestinians and Hamas in particular," Fahmy said.

Last week, an Egyptian writer accused Hamas of militant violence in Egypt, and called on people in Gaza to rebel against the group.

"We are not going to support you going forward or have sympathy for you unless you get rid of the Hamas gang, which puts you in conflict with the world, Israel and the Egyptians," Adel Nouman wrote in an opinion piece for daily newspaper El Watan. "This is the stance of the Egyptian people."

Some went further, praising Israel's assault on Gaza.

"I'm telling the Israeli army, the Israeli people and the Israeli leaders: You are men," media personality and staunch adversary of political Islam, Tawfiq Okasha, declared in a TV broadcast.

Despite the Hamas bashing, support for Palestinians and hostility toward Israel have not disappeared from Cairo's streets.

Umm Youssef, 33, who was visiting from southern Egypt, said, "Egyptians and Palestinians are one people, one nation."