The security agents lurked in alleyways, at metro stations and in armored cars, looking for signs of trouble. They wore white uniforms, black riot gear or street clothes, in a cursory effort to mix in with the crowds.
President Abdel Fattah el-Sisi of Egypt sent what seemed like all of his men onto the streets of Cairo on Monday, in a show of force and anxiety aimed at preventing any protests against his rule, and denying his growing chorus of critics any public space.
The effort was successful, in a way. The demonstrations, called to protest Mr. Sisi’s recent decision to transfer two islands to Saudi Arabia, never happened at several prearranged meeting spots, after the authorities surrounded the areas with officers, barricades and armored cars.
“We have been walking around for two hours now, trying to find somewhere we can put a toe without getting shot or arrested,” said a 22-year-old protester, who refused to give her name for fear of government retribution.
But the stifling security also felt like the fretful reaction of a leader unexpectedly confronting skepticism and negative scrutiny. Mr. Sisi, a former general, gained both power and public adoration by leading the military ouster of his predecessor, Mohamed Morsi, in 2013.
As president, Mr. Sisi has recently faced questions over his handling of the economy and abuses by his security services as well as the transfer of the islands, Sanafir and Tiran — even though the government has said that the islands originally belonged to Saudi Arabia.
This month, a demonstration in downtown Cairo against the transfer of the islands turned into one of the largest protests against Mr. Sisi, punctuated by incendiary chants that called for the fall of the government and drew parallels to Egypt’s 2011 uprising that ousted President Hosni Mubarak.
When youth groups and opposition political movements called for a repeat of the protests on Monday, the authorities drew a line, saying demonstrations would not be tolerated.
“I see people pushing us, trying to compromise security and stability once more,” Mr. Sisi warned Sunday in a televised speech.
Dozens of antigovernment activists were arrested in the days before the protests. On Monday, security men fanned out across the city in numbers that suggested preparations for a foreign invasion.
“They are scared of us, and we are scared of them,” the 22-year-old protester said. “They can lock down all the squares, but we will still find some street, some alleyway. It is endless cat and mouse.”
As she spoke, a space for protest briefly appeared, in a square in the Dokki neighborhood that the police had failed to secure. Seizing the moment, dozens of young people gathered and chanted against the government, in the shadow of apartment buildings and fast food restaurants.
Residents watched from balconies, and one threw water onto the demonstration, several times, as if trying to extinguish it. Then police officers surged into the square, scattering the protest, just minutes after it had begun.