Gunmen ambushed a bus carrying Israeli troops southeast of Beirut today in Israeli-controlled territory near Syrian lines, killing six soldiers and injuring 22, the Israeli military command said.

There was no indication tonight who the gunmen were, but Palestinian guerrillas previously have carried out several ambushes and laid mines on roads in areas occupied by Israel in southern and eastern Lebanon.

The number of Israeli casualties in the attack was believed to be the highest in any incident since the end of the fighting in Beirut and the evacuation of Palestinian guerrillas from the city in late August.

There was no immediate reaction from Jerusalem, but there was concern here that Israel would retaliate with a raid on Syrian positions in Lebanon's eastern Bekaa Valley, as it has on similar occasions in the past. Israel repeatedly has said that it holds the Syrians responsible for any Palestinian guerrillas who infiltrate Israeli lines and stage attacks.

U.S. special envoy Philip C. Habib met with Syrian President Hafez Assad in Damascus to discuss the American-proposed plan for a simultaneous withdrawal of Syrian and Israeli troops from Lebanon. Afterward, Habib left for Rome on his way back to Washington.

Habib has been quoted in the local press as saying that both Syria and Israel already have agreed "in principle" to withdraw from this country and that he hopes the pullbacks can be achieved by Christmas.

Israeli Foreign Minister Yitzhak Shamir said that chances were "bright" that Israeli, Syrian and Palestine Liberation Organization forces would withdraw from Lebanon "very soon," hopefully by the end of the year.

Interviewed on the television program "Face the Nation" (CBS-WDVM), Shamir said a pullback by Israeli forces from the seat of the Lebanese government at Baabda near Beirut should be considered as part of the general Israeli withdrawal from Lebanon. U.S. officials have urged Israel to withdraw from Baabda immediately, saying that Israel's commitment to evacuate Beirut includes a pullout from Baabda.

The attack on the troop bus took place about half a mile east of the mountain town of Alayh on the Beirut-to-Damascus highway about six miles from the Lebanese capital. The soldiers were returning from leave in Israel in a civilian bus when the gunmen riddled the vehicle with automatic weapons and a rocket-propelled grenade, military sources said.

Israeli helicopters arrived almost immediately to evacuate the wounded, while other soldiers, aided by Christian militamen, set up roadblocks and began to hunt for the assailants.

Following the incident, Israel was expected to insist even more firmly on the withdrawal of the remaining Palestinian guerrillas from Lebanon as the first stage of any overall agreement on removal of foreign troops.

Little has been said about how the negotiations are going. But it is already clear that a main stumbling block to an accord concerns the fate of the 5,000 to 10,000 Palestinian guerrillas still present in Lebanon in the north around Tripoli and in the east behind Syrian lines.

Israeli officials have said that the guerrillas must leave before Syria pulls out its 25,000 to 30,000 troops from the Bekaa Valley. Israel feels that it must rely on Syria to apply pressure on the Palestinians or there will be no way to ensure their withdrawal.

The Syrian government has said that the Syrian and Palestinian withdrawals are separate issues and that the PLO alone is responsible for deciding whether the guerrillas leave Lebanon.

Shamir said in the television interview that he did not think that ensuring a PLO withdrawal would be an obstacle because he doubted that the PLO troops would stay in Lebanon without Syrian protection.

The Beirut daily newspaper Al Anwar carried details of what it reported to be the proposed U.S. plan for a phased withdrawal of Israeli and Syrian troops. It described a three-step plan in which the Israelis would pull back first to the Zahrani River about 30 miles south of Beirut and then to the Litani River, roughly 20 miles north of the Israeli border. Syria simultaneously would withdraw first from the Bekaa Valley and then from the rest of Lebanon.

The final phase would involve negotiations between Israel and Lebanon, with the United States acting as intermediary, for removal of all remaining Israeli troops from Lebanese soil.

Confirmation was not available that this was the U.S. plan, and the paper did not report what was envisaged for the Palestinians.

Shamir said he did not think that Israeli troops would have to remain permanently in southern Lebanon to prevent a return of PLO guerrillas, although he did not exclude the possibility. He said that an international peace-keeping force in the area "will not be the solution" but that the Lebanese and Israeli governments should agree on measures to keep out the PLO.

Meanwhile, U.S. officials asked the Israelis to withdraw two tanks that suddenly appeared within 250 yards, or firing range, of American Marines guarding Beirut international airport.

The result of the U.S. request was not known. The Israelis said the tanks were needed to control a road leading to the Beirut-to-Damascus artery, but the Americans said the tanks were in the wrong place for this mission.