CAIRO – Tens of thousands of Islamists and young activists massed Friday in Tahrir Square, confronting Egypt’s ruling military council with the largest crowd in months to protest the generals’ attempt to give themselves special powers over a future elected government.

While united against the army, however, conservatives and liberals were jockeying among themselves for votes in crucial parliamentary elections only 10 days away.

The stakes are higher for all sides than at any time since the uprising that ousted President Hosni Mubarak in February. The victors will help choose who will draft a new constitution, thus defining the character of post-revolutionary Egypt.

Most of this year’s rallies in Tahrir Square since Mubarak’s ouster have been led by liberal- or left-leaning groups, but Islamists dominated Friday’s protest. Members of the Muslim Brotherhood, Egypt’s best-organized group, carried signs and waved flags bearing the logo of its Freedom and Justice party. Elsewhere, ultraconservative Salafis in long robes and bushy beards called for application of Islamic Sharia law.

The mobilization by the Brotherhood, which had until recently avoided confrontation with the ruling Supreme Council of the Armed Forces, reflects a shift in the group’s position. It has threatened to escalate its protest campaign if plans to give permanent political powers to the military are not scrapped.

“The army has no role in ruling people,” said Hani Hegazi, who came from outside Cairo with other Brotherhood members. “Its only job is to protect the country. We want civilian rule chosen through democracy.”

Other protesters carried banners reading “Down with military rule. Egypt our country is not a military camp.” Many had Egyptian flags, while some religious conservatives waved flags calling the Quran, Islam’s holy book, “our constitution.”

The rally’s primary target was a document floated by the government that declares the military to be the guardian of “constitutional legitimacy,” suggesting it would have the final word on major policies, and possibly legislation, even after a new president is elected.

The document, meant to spell out guiding principles for the new constitution, would shield the military and its budget from civilian oversight. An early version said the military would appoint 80 members of the 100-person constitutional committee.

Groups across the political spectrum rejected the document, calling it an attempt by the military to perpetuate its rule past the post-Mubarak transition period.