ALGIERS, DEC. 27 -- Muslim fundamentalists swept to power in Algeria, gaining almost half the seats in the country's first multi-party legislative elections held Thursday, officials said today.

Crowds of chanting supporters filled the streets of this capital city, and an Islamic leader vowed that people's tribunals will "try the traitors who have opposed us."

Political analysts predicted that the Islamic Salvation Front would easily gain control of the National People's Assembly during runoff elections next month, setting the stage for the Arab world's first freely elected Islamic fundamentalist government. They also said there might be a showdown with the army if the transition does not go smoothly.

The Islamic Front had gained at least 187 of the assembly's 430 seats, needing to win only 29 of the 176 seats being contested in the runoff Jan. 16 to take control of Parliament. In many of those districts, the party already has claimed 41 percent to 49 percent of the vote.

The ruling National Liberation Front, increasingly discredited among the huge numbers of unemployed youths who stand listlessly around the streets of Algiers, won only 18 seats outright.

Most diplomats -- and privately, many government officials -- predicted that the fundamentalists easily would gain at least a 60 percent majority.

"Don't be afraid, people of Algeria. This is the march of history," Imam Abu Kheireiddine exhorted an estimated 20,000 followers at the Kouba Mosque in the hills above Algiers. "Step by step, first we get into Parliament, and in the end we will constitute an Islamic republic. . . . The time has come to put into action all that we have promised. Until now, we have been talking. Now, we must act."

Other Islamic Front leaders called for immediate presidential elections, for an end to alcohol sales and "ostentation," and encouraged Algerian women to wear the conservative veil dictated by the Koran. "The Algerian woman never wanted to show her body or fight the law of God," Kheireiddine declared. "I call upon our sisters who have taken the veil off, who have become merchandise to be bought and sold, to return to Islam."

The reaction to the election results in this old colonial seaside city ranged from euphoria to alarm. Crowds of young men gathered in the streets, shouting the name of the Islamic party and their willingness to die for their faith.

Ali, 32, a cab driver, bounded from his car to join Friday prayers at Kouba Mosque and declared that the days of the National Front were over, after 30 years of one-party rule. "For 30 years they ate alone, and now it's our turn," he said.

But a 35-year-old businesswoman who travels abroad often and wears tight skirts at work shuddered at the news, saying: "I'm destroyed. It's incredible. I'm sick. We have two choices. We can either leave, because it will be another Iran, or we can pray and pray and pray that the army takes over."

The apparent Islamic victory is likely to be worrisome to nearby Arab regimes, which have been flirting with democracy but fear Islamic fundamentalism as the price.

Morocco, Tunisia, Egypt and Jordan have all been battling the rising political influence of Muslim fundamentalist groups, some of them accused of trying to overthrow existing regimes, and Sudan's military regime has installed an Islamic government in Khartoum. Nearly all have shuddered at Algeria's decision to legalize Islamic parties, then to open the way for free national elections.

"Oh, my God. This is the worst," said a Moroccan government official, who flew to Algiers to observe the elections.

The swiftness of the victory was stunning. The government had predicted two days before the election that all but 15 percent of the National Assembly seats would be left to be decided in the runoffs.

A National Front official who works in the Foreign Ministry said that demographics, not religion or politics, was largely to blame. More than 70 percent of the population is younger than 25; they have little hope for marriage, an apartment or a job under Algeria's present economic circumstances, he said. "All of us, our time is over," he said. "I'm over 40. Do you know that only 25 percent of the population is over 40? Our time is finished.

"This is a tidal wave, and after it, there will be no democracy," he added. "They will come to power, and everyone else will be finished."