Israel expressed bafflement today at the Soviet Union's warning that Israel is planning to attack Syria and denied that it is planning military action against any of its neighbors.

"The Soviet accusation is baseless," a Foreign Ministry official said. "Israel has no intention of attacking anyone. Everyone can see we are working for the total withdrawal of all foreign forces from Lebanon. We don't know what is behind the accusation because the Soviets know as well as we that it is baseless."

At a rare meeting with opposition Labor Party leader Shimon Peres, Prime Minister Menachem Begin called the Soviet threat "totally artificial." He said, "I am of the view that Syria has no reason to attack us. We, for our part, have no plans to attack Syria."

In Washington, the State Department said Thursday it had no information to suggest that Israel was planning military action against Syria or Syrian forces in Lebanon's Bekaa Valley, Reuter reported.

Tass, the official Soviet news agency, published a statement yesterday that warned Israel to stop "playing with fire" by allegedly plotting to attack Syria.

"New, disquieting reports are coming in from the Middle East, where the situation has already been dangerously strained," the Tass statement said. "Military preparations are being conducted in Israel undisguisedly with a view to delivering a piratic strike at Syria."

The statement noted that Syria and the Soviet Union signed a friendship treaty in 1980 and that Damascus has the support of the Soviet Bloc.

There were some published commentaries here today that ominously compared the Tass statement to Soviet warnings to Israel that immediately preceded the outbreak of the 1967 war. Government officials, however, took a more cautious view, with some speculating that the statement was part of Moscow's campaign to regain a major role in Middle East diplomacy.

Israeli officials said they considered the Soviet warning "serious," but added that there are no signs of an approaching military conflict with Syria. At the same time, however, there is a general recognition among officials here of a rise in tension in the area as the negotiations for a withdrawal of foreign troops from Lebanon remain in an apparent deadlock.

Syria has about 35,000 troops in eastern and northern Lebanon along with several thousand Palestinian guerrillas. Israel has not disclosed the size of its force in southern Lebanon, but it is thought to be of at least equal strength.

There have been unconfirmed reports in recent days that both sides have begun reinforcing their units in Lebanon.

The coming of warmer weather to Lebanon has been accompanied by a sharp rise in the number of clashes between the Israelis and guerrilla forces in Lebanon. According to military officials here, there have been nine incidents in March, in which three Israeli soldiers were killed and 19 wounded.

This was considerably more than the number of incidents and casualties in January and February, and there is a fear here that improved weather will make a continuing escalation in the number of clashes between the forces more likely.

In addition, the Israelis have expressed grave concern over the installation of Soviet-made, long-range SA5 surface-to-air missiles in Syria. Manned by Soviet technicians, the missiles have a range that puts them within striking distance of Israeli airspace.

The SA5 missiles are considered a particular threat to Israel's U.S.-supplied Hawkeye radar planes, which during the war in Lebanon were able to cruise at low speed outside the range of other Soviet-made missiles used by the Syrians while providing both offensive and defensive radar assistance to Israeli fighters and bombers.

The presence of Soviet technicians at the missile sites clearly complicates Israel's task in planning to knock out the missiles in any future clash with Syria. It also increases the risk that an Israeli-Syrian conflict would lead to a direct superpower confrontation.

The escalation in terms of rhetoric and actual clashes in recent weeks has come against a backdrop of continued diplomatic stalemate in the troop withdrawal talks. U.S. special envoy Philip C. Habib returned to the United States today after a final meeting last night with Foreign Minister Yitzhak Shamir and Defense Minister Moshe Arens.

According to Israeli officials, Habib, who arrived here from Beirut, proposed no "new ideas" from the Lebanese to break the deadlock. Officials said the key issue is still Israel's insistence that Saad Haddad, a former Lebanese Army major who is allied with and supplied by Israel, remain in command of his militia units in southern Lebanon.