Arab leaders tonight formally adopted their first joint Middle East peace plan, offering implicitly to recognize Israel and spelling out terms for living in peace with it.

The eight-point proposal calls for the withdrawal of Israel from all Arab territories occupied since the 1967 war, establishment of a Palestinian state with East Jerusalem as its capital and recognition of the Palestine Liberation Organization as "the sole, legitimate representative" of the Palestinian people.

The plan, adopted unanimously by representatives of 20 states and the PLO attending a summit of the Arab League, was embodied in resolutions read by Moroccan Foreign Minister Mohammed Boucetta at the public closing session of the conference. The summit failed to come to any decision on a request by Syrian President Hafez Assad to withdraw his forces from war-torn Lebanon.

The Arab peace plan is similar to the one submitted by Saudi Arabian King Fahd to a first session of the summit here last November. But several changes were made, apparently to gain the support of the more radical Arab states that had refused to support the plan then.

Israel had already strongly denounced the original Fahd plan last year, and the Reagan administration is not likely to be pleased by the failure of Arab leaders to give more than implicit recognition of Israel while insisting on an independent Palestinian state.

Point seven of the plan, which was the cause of dissension at the summit here last November, calls on the U.N. Security Council to guarantee peace for all states in the region. While Israel is not mentioned by name, the proposal specifically refers to a Palestinian state as among those whose security should be secured.

The Fahd plan called only for the recognition of the right of all states in the region to live in peace, without mentioning any country or the Palestinians by name.

The summit formally decided to send a delegation to Washington and other European capitals to discuss their plan and the proposals for a Middle East settlement put forth by President Reagan in his speech last week.

Other major resolutions announced tonight gave Iraq clear pan-Arab backing in its war against Iran and supported Somalia in its border fighting with Ethiopia. Syria, long at political odds with Iraq, had previously refused to give Iraq its backing and even supported the Iranian side in the Persian Gulf war. Thus Iraq's President Saddam Hussein seemed to have scored a major political victory here.

Another resolution condemns Israel's invasion of Lebanon and pledges Arab support to help obtain the withdrawal of Israeli forces from the country.

But the summit was unable to come to any decision on a request by Lebanon for an end to the mandate of the Arab peace-keeping force--actually 30,000 Syrian troops stationed there since the end of the 1975-76 Lebanese civil war. In this connection, the Arab leaders appeared to be taken by surprise when Syria's Assad, aware of the Lebanese request, announced yesterday that he too sought to withdraw the troops.

After an extra day of deliberations on the Lebanese request and Assad's offer, the summit adopted a resolution simply asking Lebanon and Syria to get together to discuss mutually acceptable arrangements for the withdrawal of the Syrian forces.

Conferences sources said the Arab leaders were seeking guarantees from the Lebanese government that it would not sign a peace treaty with Israel, as well as Lebanese guarantees for the protection of 500,000 Palestinian civilians remaining in that country, as part of a deal involving the withdrawal of Syrian troops.

Observers here said the main concern of the summit in debating Assad's request was to avoid making the withdrawal of Syrian troops look as if the Arab world was bowing to yet another Israeli demand in Lebanon.

Since the Israeli invasion June 6, Prime Minister Menachem Begin and other Israeli officials have repeatedly said that one of their main objectives was to get Syrian forces out of Lebanon.

Reports reaching here from Damascus said President Assad was seeking ways in any case to cut Syrian military and diplomatic losses in Lebanon. Syria now has far more than the 30,000 Arab Deterrent Force troops stationed in and around the Bekaa Valley to protect approaches to Damascus, the Syrian capital in the country's agricultural heartland further to the north, from Israeli forces which are also in the valley.

Israel has largely destroyed the Syrian Air Force and also taken out by air attacks Syrian antiaircraft missiles stationed in the Bekaa Valley, leaving Assad's forces there exposed to Israeli ground and air strikes.

Syria is reported to have asked the United States, both directly and through Saudi Arabia, to help arrange for a mutual withdrawal of Israeli and Syrian troops from Lebanon.

Observers here said this helped to explain why Assad has ended his hard-line opposition to the outlines of the Saudi peace plan. Last November, Syria was responsible for the breakup of the first session of this 12th Arab summit, refusing to go along with the Saudi plan.

It perhaps also explained why Assad has not come out against the proposals put forth by President Reagan for a Middle East settlement.