Israeli and Lebanese soldiers fought a gun battle today outisde the Ministry of Defense building on the eastern outskirts of the city in the first clash between the two armies since the first days of the Israeli invasion of Lebanon last June.

There were conflicting versions of the incident, but both sides agreed that two Lebanese soldiers were killed and one Israeli was wounded in the unusual firefight that, according to the Lebanese Army account, lasted 15 minutes.

The clash came against a background of continued sectarian fighting between Moslem Druze and Christians in the mountains southeast of the capital and renewed battles between two Moslem groups disputing control of the northern city of Tripoli that reportedly left seven more dead and 13 wounded today.

The three arenas of conflict were a painful reminder to Lebanese and outsiders alike of the steadily deteriorating security situation across this country much of whose territory is still occupied by foreign troops.

American efforts to get negotiations started among Israel, Lebanon and Syria for a withdrawal of all foreign forces have been totally stymied by Israeli demands that the talks be held in Jerusalem and Beirut and include normalization of relations between the countries. Lebanon has rejected the demands.

Special U.S. envoy Philip C. Habib and his assistant Morris Draper have returned to Washington to review the stalled efforts to get negotiations going and to discuss with top officials what action to take next.

The clash today between the Lebanese and Israeli armies took place just outside the entrance to the Defense Ministry and Army headquarters in Yarze in the mountains a few miles east of the city.

According to the Lebanese account, an Israeli patrol got into an argument in the early afternoon with soldiers of the Lebanese Army Special Forces guarding the entrance to the Defense Ministry compound.

The dispute then degenerated into an exchange of fire that lasted 15 minutes, an official Army statement said, without indicating which side had fired first.

Israeli Army spokesman Lt. Col. Arie Brosh said the patrol consisted of two jeeps of soldiers accompanying an ambulance and that it was fired upon from the direction where the Lebanese guards were standing, wounding one Israeli with three bullets in the leg.

The Israelis then returned the fire killing two Special Forces soldiers. He said the Israeli patrol was "apparently convinced it was an ambush," but added that there was "a good possibility" that the shooting had started by accident.

What neither official account mentioned, but Lebanese and diplomatic sources reported later, was that the Israelis were traveling along a road behind the Ministry of Defense compound which is normally off limits to the Israeli Army.

The Special Forces guards were apparently challenging the Israelis' right to be on the road which links with the main Beirut-to-Damascus highway at an intersection in front of the Defense Ministry.

Meanwhile, two high-ranking Egyptian diplomats arrived here unexpectedly today with a message for Lebanese President Amin Gemayel from President Hosni Mubarak regarding negotiatinons over the withdrawal of foreign troops.

Lebanon at present does not have diplomatic relations with Egypt because of its peace treaty with Israel, and this was the first time it has publicly received any Egyptian diplomats since relations were broken.