Tens of thousands of Islamist demonstrators thronged Tahrir Square on Friday to call for a more pious state, a stunning show of force that left the liberal pioneers of Egypt’s revolution reeling.

The rally — the largest here in months — comes as Egyptians make fundamental choices about what sort of nation will emerge following the abrupt end in February of former president Hosni Mubarak’s three-decade reign. Friday’s demonstration had been intended to highlight Egyptian unity, but instead laid bare deep divisions.

Most of those who participated in the demonstration appeared to be followers of the strict Salafist school of Islam. They were joined by members of the relatively more moderate Muslim Brotherhood, as well as others who advocate a greater role for religion in the nation’s governance. It was the boldest and most resolute display to date from a community that Mubarak kept largely invisible and in disarray.

The demonstrators were bused in from across Egypt, reflecting a level of organization that could give Islamists a significant advantage in parliamentary elections scheduled for November.

Islamist parties, which advocate for a society rooted in Islamic law and scripture, had largely boycotted recent demonstrations. But leaders said the time had come to speak out against what they see as attempts by Egypt’s interim military rulers, and by liberal politicians, to quietly enact constitutional changes that would enshrine Egypt as a secular state.

The call to reject those moves was answered by a a sea of bearded men and women draped in black garments. Vendors sold flattering portraits of slain al-Qaeda leader Osama bin Laden and former Iraqi dictator Saddam Hussein, as speakers railed against the United States and Israel.

“Secularists are all over the media, trying to marginalize us because they think we’re ignorant,” said Islam Farris, a 23-year-old pharmacist who demonstrated in Tahrir. “For the first time in history, all Islamic movements are united here because the secularists are provoking us.”

For advocates of a secular Egypt, the rally was seen as another worrisome development following months of decisions by the ruling military council that have dimmed hopes for a smooth transition to democracy.

Islamist and secular leaders had previously agreed to stand united on Friday, calling for shared goals such as the speedy prosecution of Mubarak and his aides, an end to military trials for civilians, and more accountability from the country’s interim military rulers.

But as the Islamists poured into Tahrir, liberal and secular Egyptians were shocked by the tone and intensity of the slogans.

“The people want Islamic law,” the crowds of sweat-drenched Salafists chanted under the punishing sun.

Islamists also turned out in huge numbers in Alexandria and Suez. In Suez, more than 10,000 Salafists gathered in Arbaeen Square and raised posters with the words “secular” and “liberal” crossed out.

Although the vast majority of Egyptians are Muslim, the number who support implementation of strict Islamic law has long been a mystery because hard-line religious communities were persecuted and harassed by Mubarak’s intelligence service.

Secular and youth groups have continued to rally in Tahrir in recent weeks, but their numbers have been sagging since demonstrators began an around-the-clock sit-in on July 8.

Ahmed Korashy, a member of the liberal Free Egyptian Movement, said he was shocked by the Salafist turnout.

“Nobody was expecting this huge number,” Korashy said. His group and a coalition of 27 other liberal and socialist parties left the square to signal their rejection of the Islamists’ message.

“The chants of ‘We want God’s law’ are irresponsible toward this revolution and this country,” said a statement released by the groups. “We do not regret our attempt to achieve unity in the interest of completing this revolution. It just proves who is disrupting this unity.”

Korashy urged his allies to rethink plans to push for implementation of a secular Bill of Rights-style document before parliamentary elections.

“This was a big mistake and we triggered a big problem that cannot easily be contained,” he said.

Friday’s rally comes as Egypt prepares to put Mubarak on trial next week. The former leader, who enjoyed close ties to the United States, was a relatively secular leader, and the military chiefs he appointed — now Egypt’s interim rulers — share that outlook.

By Friday night, the Salafists had largely left Tahrir, but earlier in the day, there had been no doubt of who was in charge.

Ahmed Medhat, a 19-year-old Islamic studies student at al-Azhar, the country’s revered religious institute, spoke to a group of Salafists before prayers in the square on Friday. He told one Salafist protester that their numbers were impressive but that now was not the time for calls for an Islamic state. They had to stick to demands for justice and the minimum wage, he said.

“You’re a secularist,” the Salafist yelled.

A crowd gathered around Medhat, as two men dragged him out of the square.

Elsewhere in Tahrir, Hagar Ragab walked among the crowd wearing a black veil. She said she did not want to force anything on anyone. But she did not want anything forced on her, either.

“I want the will of the people,” she said. “If that’s God’s law, then that’s what it should be. If it’s secularism, then we will accept that.”

Special correspondent Sulafeh al-Shami contributed to this report.