Thousands of armed Shiite Moslem militants and their fundamentalist supporters descended on the port city of Sidon today, tearing down the Lebanese flag and calling for the Islamization of Christian-led Lebanon and the overthrow of President Amin Gemayel.

Brandishing weapons and chanting slogans against Gemayel, a Christian, the demonstrators, who drove to Sidon in a convoy of 300 cars and buses, went on a rampage, smashing liquor stores and demanding the creation of an Iranian-style Islamic republic, according to reports from the city, 20 miles south of Beirut.

The demonstration, which ended when the militants returned to their Shiite sections of Beirut, came two days after Israeli forces left Sidon in the first stage of their withdrawal from Lebanon and a day after Sidon's residents gave Gemayel and other officials of the central government a jubilant welcome in their first visit to Sidon since the Israeli occupation began 2 1/2 years ago.

Troops of the Lebanese Army, who had moved into Sidon when the Israeli forces left, appeared powerless to stop the rampaging militants today and made little attempt to intervene.

While the militants demonstrated, the mainstream Shiite Moslem Amal militia held a separate rally more in tune with the expressed wishes of the city's Christian and Moslem leaders and the central government to prevent communal hostilities in the wake of the Israeli departure.

In a Shiite suburb of Beirut, a car-bomb explosion on a street near an office of Amal killed three people and injured about 40, police said, according to The Associated Press. There were no claims of responsibility and no indication whether the bomb was related to the demonstrations in Sidon.

The militant show of force by the Shiite fundamentalists in Sidon today and combative remarks on Saturday by Druze leader Walid Jumblatt suggested to some observers that despite the general mood of euphoria in Sidon over the weekend, worsening economic conditions in Lebanon could be exploited to undermine the Gemayel government. Jumblatt had called for the overthrow of Gemayel, whom he called "the shah of Lebanon."

It is not clear yet whether today's outbreak by the Shiites from Beirut will cause tensions among the communities in Sidon, where Moslem and Christian leaders had agreed in advance of the Israeli pullout to ban armed militiamen from the streets and to rely on the Lebanese Army for security. Sidon, Lebanon's third-largest city, has about 70,000 Sunni Moslems, 20,000 Shiite Moslems and 10,000 Christians.

The gunmen who swarmed into Sidon said they were members of Hezbollah, or the "Party of God," one of the most militant of the Shiite fundamentalist factions that have formed in Lebanon since the Iranian revolution.

They honked their horns and chanted, "God is great -- We want a Moslem city and an Islamic republic," in a frenzied two-hour demonstration.

Lebanese Army soldiers who had marched triumphantly into Sidon and all the way south to the Litani River, Israel's new defense line, made no attempt to stop the demonstration.

At one point, demonstrators ripped down one of the many Lebanese national flags that have adorned Sidon for the past two days. A Lebanese soldier tried to hoist it again, but a defiant demonstrator pulled it down again.

The posters ridiculed Gemayel's visit to Sidon and the Army, which also had received a warm welcome here yesterday.

"Where was the Army when the Israelis were here?" one placard asked. The militants carried pictures of Iranian leader Ayatollah Ruhollah Khomeini and prominent Lebanese Shiite clerics.

Hezbollah yesterday announced its intention to seek Islamic fundamentalist rule in Lebanon.

"We do not hide our commitment to Islamic rule and we call on all the people to chase this regime," it said. It pledged that Hezbollah would fight "abomination to its roots" -- a presumed reference to Gemayel's administration.

In contrast, the separate Shiite Amal demonstration welcomed the end of Israeli occupation and praised the National Resistance movement for guerrilla fighting against the Israeli occupation forces, as the city's Christian and Moslem leaders and Gemayel had done yesterday.

The resistance movement, begun by leftists, had assumed a largely Shiite character in the last few months as operations against Israeli soldiers and their Lebanese allies were stepped up.

Amal leader Nabih Berri has said he fully backs the resistance movement. But Amal also supports a continued multireligious Lebanese state. The Amal demonstration today pressed nationalist, not Islamic, slogans and Amal officials privately criticized the Hezbollah outbreak.