Israeli troops withdrew from the Lebanese port city of Sidon after 32 months of occupation Saturday, completing the first phase of a three-stage withdrawal plan meant to finally end Israel's longest conflict.

The pullout came on a rainy Jewish Sabbath, two days ahead of the Feb. 18 deadline originally set by the Israeli government for completion of the initial pullback. Government sources said the surprise timing was intended to foil any plans Lebanese guerrillas might have had to attack the withdrawing troops.

Only about 300 troops were involved in the final evacuation of Sidon--a small fraction of the Israeli soldiers still in Lebanon, estimated to be as many as 20,000. Most of them withdrew in a 38-vehicle convoy that traveled almost directly eastward through a series of mostly Christian villages toward new Israeli positions running on a line southwest from near Jezzine to the Litani River, north of Tyre.

Christians Less Hostile

The Christian villages are considered less hostile than the primarily Shia Muslim villages along any alternate withdrawal route. The army prohibited civilian traffic along the evacuation route, and few Lebanese were on the streets of the towns along the way.

As the convoy passed the Hariri Medical Center here, several soldiers waved at foreign correspondents escorted north by the army to witness the withdrawal. A few flashed V-for-victory signs. But most just looked tired as they began the withdrawal.

"From our point of view, everything goes well," said Israeli Defense Minister Yitzhak Rabin, who helicoptered north from his Tel Aviv office to supervise the operation from a hill near the Awwali River overlooking Sidon.

The army announced Saturday evening that the operation was completed by mid-afternoon without incident.

Less Than Half Size of L.A.

Evacuated Saturday was an area less than half the size of the city of Los Angeles--a triangle-shaped section containing only about 20% of the Lebanese territory occupied by the Israelis but holding nearly one-half the increasingly restive local population that had been under Israeli army control.

The government has approved the next two phases of the withdrawal in principle but must still vote on their timing. And opponents of the pullout are expected to use any increase of hostile activity in the region as an argument to delay or even cancel the rest of the withdrawal.

In a much larger and more significant second stage, expected in about three months, Israeli forces are scheduled to withdraw from positions in the Bekaa Valley, where they face Syrian troops across a narrow no man's land.

Withdrawal to Border

In the third phase, which the army hopes to complete by the end of September, Israeli troops are to withdraw to the international border, possibly leaving behind token forces to help patrol a six-mile-deep "security zone" just north of the border.

The Israelis had been in control of Sidon since they seized it with an amphibious assault and fierce house-to-house fighting on June 9, 1982--just three days after the army marched north with the mission to destroy Palestine Liberation Organization forces that had become entrenched in southern Lebanon beyond Israel's northern frontier.

What started as a war against the Palestinians, however, eventually evolved into clashes with indigenous Shia Muslims and other southern Lebanon residents as Israel's initial lightning strike turned into a lengthy occupation.

Resistance Movement

The southern Lebanese organized themselves into a resistance movement that took a heavy toll of Israeli lives with guerrilla-style attacks. According to Israel's figures, there have been more than 150 attacks on its troops in southern Lebanon during the last six weeks alone.

However, Israel's chief of staff, Lt. Gen. Moshe Levy, who together with Rabin supervised Saturday's pullback, rejected suggestions that his army was defeated by the stiffening guerrilla resistance.

"I don't feel at all defeated," Levy told correspondents covering the withdrawal. "I don't think that the guerrilla war is finished. And where we deploy our units--it's not a question of being defeated but a question of how we want to operate our units."

Vehicles Stripped, Loaded

At a staging area near the village of Mashnaka, the withdrawing troops stripped their armored personnel carriers of radio antennas and other gear so that they could be driven up dirt ramps onto tank carriers for the trip south. A line of open-sided troop transports stood nearby to take the men home.

"I'm so glad to be here and speaking to you and to know I'm leaving alive," said Shavit Snir, an army medic.

"It's a happy day," added Sgt. Yoram Aharnyan, 28.

Several soldiers used a makeshift field communications center at the site to call relatives in Israel.

'Everything Is Fine'

"Everything is fine," one yelled into the standard white plastic receiver. "Don't worry--I'm going to be home soon."

Lebanese employees of the Hariri Medical Center here were at least as pleased to see the Israelis leave as the Israelis were to go.

Asked why he was glad about the troop departure, Thesien Judi, an American-educated bio-medical engineer, commented, "If you think of yourself as a free man, then you know what freedom is all about."

Judi said the primary result of the occupation was "the destruction of the Lebanese economy . . . not to mention the thousands of men killed and injured."

The first Israeli armored personnel carrier rumbled up a steep incline in front of the Hariri center at about 2 p.m. Saturday, just as the sounds of happy residents cheering the arrival of the Lebanese army in Sidon could be heard in a British Broadcasting Corp. report over one correspondent's shortwave radio.