CAIRO — Tens of thousands of Egyptians packed into Tahrir Square in central Cairo on Friday in a spasm of last-minute concern that Egypt’s ruling generals might be trying to sabotage the promised transition to civilian democracy after the presidential election beginning next month.

The crowd was as large as any that has gathered in the square since the protests that forced out President Hosni Mubarak in February 2011. Even more unusual in the increasingly polarized political climate, Islamists, liberals and leftists all found common ground on at least one front: the demand that the generals, who took power with Mr. Mubarak’s ouster, finally give it up.

The catalysts for the protest were the military-led government’s management of the early stages of the election, and in particular the selection of the candidates. In the past two weeks, Mr. Mubarak’s former spy chief, Omar Suleiman, began a short-lived campaign from inside the office of the intelligence services that set off fears of a plot to restore the old order.

In that same period, a commission of Mubarak-appointed judges unexpectedly blocked Mr. Suleiman and two Islamists from running. They had been considered front-runners for president. And the top military leader suggested that a new constitution should be written and ratified before a handover of power, meaning the military leaders would control that process, too, and have the ability to safeguard their own powers and interests.