Israel's invasion force swept northward through Lebanon yesterday, capturing major Palestinian strongholds and encircling the coastal city of Sidon just 20 miles south of Beirut.

As guerrilla-controlled towns and bases across southern Lebanon--including Tyre, Nabatiyah and the once-impregnable Beaufort Castle--fell to the Israeli invaders, Israel's Army chief of staff, Maj. Gen. Rafael Eitan, declared that the invasion was ahead of schedule in its objective of clearing a 25-mile-deep buffer zone of "all terrorists." Details, A11.

Both Israel and the Palestine Liberation Organization told of bloody, hand-to-hand fighting in some areas, in addition to heavy artillery shelling and an Israeli bombing raid on the section of Beirut where PLO leader Yasser Arafat's headquarters is located. The Israeli Army command later announced that 25 Israeli soldiers had been killed and 96 wounded in the two-day-old invasion. The PLO did not announce any casualty figures.

Special U.S. envoy Philip C. Habib, sent to the area Sunday by President Reagan, met with Prime Minister Menachem Begin with little apparent success. A close adviser to Begin said the prime minister told Habib that Israel will withdraw from Lebanon only when it has guarantees that the PLO will not return to the south, from where it has been shelling northern Israeli towns.

The Reagan administration sought to avoid public recriminations against Israel, with the State Department repeating its call for Israeli forces to withdraw and for Palestinians to stop using the area as a base for its attacks on Israel.

In London, Secretary of State Alexander M. Haig Jr. said he had received a "strong" message from Egyptian President Hosni Mubarak demanding that Israel withdraw from Lebanon. When asked whether the fighting there was developing into another Middle East conflict, however, Haig responded, "It is too early to say if it is war."

Two rockets struck the U.S. Embassy in Beirut, causing damage but no casualties. The Pentagon sent five U.S. warships with about 1,800 Marines to the eastern Mediterranean in case it becomes necessary to evacuate the estimated 4,000 Americans in Lebanon.

Syria, apparently moving closer to direct involvement in the fighting, said five of its soldiers, part of a 23,000-man peace-keeping force in Lebanon, were killed in a clash with Israeli troops near Nabatiyah. A Syrian Mig23 was shot down over Beirut when, for the first time during this conflict, Syria sent its warplanes against Israeli fighter-bombers.

But Syria still has not committed fully either its Air Force or its regular infantry, and Israeli officials continued to say that they were attempting to avoid direct contact with Syria--a development that could broaden the fighting into a new general Middle East war.

The three-pronged invasion early Sunday by an estimated 20,000 Israeli troops and hundreds of tanks, the biggest since a similar force moved into southern Lebanon in March 1978, was expanded yesterday with landings of paratroops and amphibious units at Sidon. The Palestinian-controlled Mediterranean seaport is 40 miles up the coast from Israel but 25 miles from the northernmost point of the Israeli-Lebanese border.

Lebanese radio said late yesterday that Israeli tanks were moving into Sidon, which had been bombarded from sea and air two hours after Israeli helicopters dropped leaflets warning residents to leave. An Israeli spokesman said an amphibious landing at the mouth of the Alawi River, just north of Sidon, was accomplished without casualties.

Israeli forces captured Tyre, a coastal city between Sidon and the border. They seized Nabatiyah, halfway between the Litani River, the northern boundary of the previous buffer zone, and the Zahrani River, the apparent point to which Israel now intends to clear guerrillas.

They also announced capture of Hasbaya, a mountain town near Mount Hermon, and, in a major military feat, captured the centuries-old Beaufort Castle, the heavily fortified redoubt that overlooks the Litani River and northern Israel. The crusader-era castle had been pinpointed by Israel as the source of much of the recent shelling of Israeli towns.

An Israeli Army officer told Israeli radio that the castle and its heavily mined approaches were taken after a "heroic battle" with its 40 to 50 Palestinian defenders.

Shortly afterward, Begin flew by helicopter to the castle to congratulate the Israeli troops.

As the ground fighting continued in southern Lebanon, three waves of Israeli warplanes bombed the southern Beirut neighborhood where Arafat's headquarters is located. The Palestinian news agency WAFA said the office was not hit but that apartment blocks and buildings of Arab University, across the street, were severely damaged. Eyewitnesses told Reuter that there were some deaths.

Except for announcements of scattered accomplishments, both sides continued a general news blackout on the combat. U.S. and U.N. sources estimate the Israeli invasion force at 20,000 troops and the PLO puts it at 45,000. Palestinian forces in the area are estimated at 6,000. Most of the 23,000 Syrian troops are at least 10 miles north of the farthest penetration of Israeli ground forces and the disjointed Lebanese Army has apparently played no part in the hostilities.

In London, meanwhile, two Jordanians and an Iraqi charged with attempting to murder Shlomo Argov, the Israeli ambassador to Britain, were arraigned yesterday.

Argov, shot Thursday, is in critical condition. Israel blamed the PLO and responded with two days of heavy bombing that, by Lebanese accounts, killed 234 people.

The PLO has denied a role in the attack. British Prime Minister Margaret Thatcher said, however, that a "hit list" of targets found on one of the suspects included the PLO representative in London--raising the question of whether the assailants are a splinter group or whether the list was intended to mislead.