The Lebanese Army, in a powerful move using infantry, tanks and mechanized battalions, crashed through west Beirut and the city's southern suburbs today in an effort to wipe out strongholds of Moslem militiamen.

By tonight, government radio reported that the Army had taken control of virtually all of the western portion of the war-torn capital, including strategic positions that had been used by the Moslem and leftist militias that have been challenging the government's attempts to assert its authority.

Lebanese and U.S. officials were cautiously optimistic that the Army, in one of its biggest operations in years, had succeeded in its efforts to retake key military positions in the capital and to deal a psychological blow to the militias, establishing the Army as the primary authority.

The state radio said 21 Lebanese soldiers were killed and 87 wounded today, bringing the toll in the fighting that began Sunday to 42 killed and 176 wounded. There were no reliable estimates of militia casualties today, although indications were that the toll was low as the fighters gave way to the advancing Army. At least 22 civilians reportedly were killed.

U.S. Marines, who on Monday suffered two killed and 14 wounded in shelling from Druze militia territory, were not involved in today's fighting, American officials said, and no casualties were reported among other contingents of the multinational force.

Throughout the day, as the estimated 10,000 Lebanese troops moved block-by-block in the advance that began with a landing of units by helicopter on the waterfront before dawn, artillery shells and sniper fire reverberated in west Beirut. Shells hit the Commodore Hotel, where most of the foreign correspondents covering Lebanon are staying, and British Embassy, which has also housed U.S. embassy offices since a bomb destroyed the American embassy in April. No casualties were reported in either building.

Battles were reported at the site of the troop landings along the waterfront east of the old American embassy, along the Green Line dividing the city between Christian- and Moslem-dominated sectors, from where the bulk of the Lebanese Army force began its operation, and in the vicinity of the Central Bank and the Hamra shopping district.

By nightfall, Lebanese troops reportedly had taken control of the 40-story Murr Tower and the Holiday Inn, as well as other buildings used by leftist militias as sniper and artillery strongholds.

Sniper firing continued into the night, amid unconfirmed reports that militiamen were moving back into positions captured during the day by the Army, but otherwise the capital remained quiet, as the government-controlled radio warned residents of west Beirut to keep off the streets.

Today's operation followed unsuccessful efforts by the government of President Amin Gemayel, a Christian, and Moslem leaders to come up with an agreement that would establish the Army's right to patrol the western sector of the capital and would also begin a political process for accommodating the demands of the various religious factions in conflict here for stronger roles in ruling the country.

Gemayel today made a new plea for a "national reconciliation dialogue" among 11 main Lebanese factions to "chart Lebanon's future within the framework of territorial integrity and total sovereignty."

Gemayel, speaking to reporters after a Cabinet meeting held during heavy shelling of Beirut today, said that "what has happened strengthens my conviction that the best way to end the crisis is direct dialogue among factional groups in order to reach a national consensus."

But Druze leader Walid Jumblatt, whose forces in the Chouf Mountains southeast of Beirut have been contesting Army efforts to move into the area, rejected the idea. In a statement issued in Damascus, Syria, Jumblatt said such a dialogue "is out of the question" in view of what he said were "the massacres at the hands of the Lebanese regime and its head, Amin Gemayel."

Nabih Berri, leader of Amal, the most powerful Shiite Moslem militia, condemned the Lebanese Army's move into west Beirut, and, with Jumblatt, appealed to other Arab states to stop "the massacre" of Moslems there.

Secretary of State George Shultz and other U.S. officials endorsed Gemayel's proposal for a dialogue that could lead to a new sharing of political power.

The present allocation of positions in the Lebanese government is based on the 1932 national census, when Maronite Christians formed a majority, followed by Sunni Moslems and then Shiite Moslems, Druze and other sects. Shiite Moslems now contend that they are a majority.

U.S. and Lebanese sources said today that the heavy shelling of the capital appeared to be coming from Syrian-controlled territory in the Upper Metn Mountains northeast of the city and Israeli-controlled sections of the Chouf Mountains to the southeast, but they said they suspected that the actual shelling was being done by Druze militiamen who are active in both areas.

American officials said Lebanese Army appeared to have excellent intelligence information for its move into west Beirut. The military objective, the officials said, was to go into strongholds of the militia, especially the areas where large arsenals of weapons were stored; the Army attempted to avoid house-house searches, which could have resulted in heavy casualties on both sides, and instead moved against specific targets.

U.S. officials said they believed this showing of force--which involved more noise than casualties and damage--would have the desired psychological effect of deterring further attacks by the militias.

At the Commodore Hotel, more than 100 foreign journalists took shelter in the basement after an artillery shell from an undetermined source hit the hotel and several other shells exploded nearby. Four rooms were destroyed and 10 damaged.

About half of the 70 U.S. Army Special Forces living at the Cadmos Hotel in a waterfront area controlled by Moslem militias were evacuated under Lebanese Army guard, United Press International reported, and taken to the British Embassy, but the others remained at the hotel without incident. The Special Forces are here as trainers for the Lebanese Army and are not part of the multinational peacekeeping force.

Moslems and Christians blamed each other today for the failure to arrive at some compromise after a reported tentative agreement late yesterday collapsed. Advisers to Gemayel said that agreement fell apart because Moslem militia leaders, who had agreed to take their fighters off the streets, appeared instead to be redeploying them along the Green Line separating Moslem and Christian areas.

U.S. officials today reportedly urged Gemayel to move toward a unity government before Israel withdraws its occupation forces from the Chouf and redeploys them to the south.

The powerful Christian Phalangist militia apparently played no role in today's move into west Beirut, although there had been indications that it would attempt to join with the Army in fighting against the Moslem militias. Gemayel reportedly gave the Phalangist forces firm orders to stay in their barracks and not get involved.

News services reported from Beirut:

Fighting also broke out in Tripoli today between rival Moslem militia groups and police said 25 people were killed and 60 wounded in battles in the city, 50 miles north of Beirut.

Radio reports said pro-Syrian gunmen had attacked the house of Abdel Majid Rafei, leader of the pro-Iraq Baath Party, who generally supports President Gemayel.