The Israeli military command today described the entry of its troops into West Beirut as a "police action," saying that the assassination yesterday of Lebanese President-elect Bashir Gemayel "indicates a desire on the part of certain elements to return by violence to the previous state of anarchy" in Lebanon.

The early-morning Israeli move into the predominantly Moslem western sector of Beirut, an action that once was thought to have been averted by the peaceful withdrawal of the Palestine Liberation Organization from the city, added a new element of uncertainty to the situation in Lebanon.

Israel radio reported tonight that Israel had assured the United States that the military action in Beirut would end in 24 hours. It added that Israeli forces had encountered unexpected resistance in the city.

U.S. envoy Morris Draper met separately here today with Prime Minister Menachem Begin and Foreign Minister Yitzhak Shamir. Both Israeli officials and Draper, who was here to begin preliminary negotiations on the withdrawal of Israeli and Syrian forces from Lebanon, said that the withdrawal remained their goal but conceded that the assassination had complicated greatly their task.

"This has changed the situation," Draper said.

Israeli Defense Minister Ariel Sharon is believed to have long favored an Israeli entry into West Beirut, even after the PLO withdrawal, to clean out the remnants of the Palestinian guerrillas and the stockpiles of arms Israel claims they turned over to armed Lebanese leftist groups in the city. The U.S.-engineered withdrawal accord proveded that the guerrillas turn their weapons over to the Lebanese Army.

The military command said in a special communique this evening that the advance was designed to prevent a regrouping of Palestinian and leftist forces.

But while Sharon may have welcomed the opportunity to advance in the city, the killing of Gemayel appeared to be a setback for the Begin government's announced hope of seeking a peace treaty with Israel's northern neighbor.

Gemayel, the 34-year-old commander of the Lebanese rightist Phalangist militia, had been allied with Israel against the Palestinians and leftist Moslem forces in Lebanon. Since his election at a special parliamentary session last month, Gemayel had come under pressure from Israel to sign a treaty.

Last week, Sharon warned that Lebanon faced a choice of signing a peace treaty or accepting a "special status" for a strip of territory about 25 miles wide in southern Lebanon that Israel considers vital to its security.

Earlier this month, Begin met secretly with Gemayel, who reportedly pleaded for Israeli patience while he maneuvered among his country's many political factions and sought to consolidate his power.

Begin today sent Gemayel's father, Pierre, a telegram expressing shock at "the criminal assassination of Bashir . . . ."

An Israeli Foreign Ministry announcement blamed Gemayel's death on "those elements that seek to undermine the independence of Lebanon." Israeli officials said they had no information on who was responsible for the assassination, but they pointed out that Gemayel had a number of enemies both inside and outside Lebanon, mentioning in particular the Syrians.

Gemayel's assassination and the Israeli move into West Beirut prompted immediate criticism of Begin by his political opponents here. Opposition Labor Party leader Shimon Peres called for the reentry into Beirut of the multinational peace-keeping force that oversaw the PLO evacuation.

Government officials described Israeli aims in the Lebanese capital as limited. Uri Porat, Begin's chief spokesman, said that the Israeli Army was ordered into West Beirut only to maintain order and prevent "dangerous developments."

According to Porat, Begin proposed during his meeting with Draper that the first step in the withdrawal involve the departure of Palestinian forces from positions in the Bekaa Valley in eastern Lebanon and around the northern port city of Tripoli. Begin said this should be followed by the simultaneous withdrawal of Syrian and Israeli troops according to a prearranged timetable and was quoted as saying that the entire withdrawal could be accomplished "in a few weeks."