Israel and the Palestine Liberation Organization both agreed today to a cease-fire in their two-week war of attrition in Lebanon, halting at least temporarily the most costly cross-border violence in more than three years.

It was the first time in Israel's 33-year history that an Israeli government agreed not to conduct military operations against Palestinian forces.

U.S. Special Envoy Philip C. Habib made the surprise announcement in a terse statement he read after meeting with Prime minister Menachem Begin. It declared:

"I have today reported to President Reagan that as of 13:30 hours [1:30 p.m.] local time, July 24, 1981, all hostile military actions between Lebanese and Israeli territory, in either direction, will cease."

Following a brief exchange of artillery fire between the Palestinians and Israleli-supported Christian militias in southern Lebanon 30 minutes after the announcement, the border was quiet early this evening.

The Israeli Army Command said Palestinian guerrillas violated the cease-fire about five hours after it took effect, however. The Israelis said the Palestinians fired Katyusha rockets at the Israeli border town of Metulla and at villages of the Christian-controlled enclave in southern Lebanon at about 7 p.m., and that three residents of the Lebanese village of Kliya were wounded. Israeli forces did not return fire, a spokesman said.

Begin said the Israeli Cabinet, which discussed Habib's proposal for a cessation of hostilities for two hours, endorsed the statement.

The agreement has enormouse implications for the PLO, which has long sought to gain a degree of legitimization through an international agreement involving Israel, even if indirectly.

[In Beirut, the PLO issued a statement accepting the cease-fire, Reuter reported. The short statement credited "the efforts of the United Nations" for the agreement.]

The careful phrasing of Habib's statement omitted any mention of the parties to the agreement and did not mention the phrase "cease-fire," saying only that hostile actions between Lebanese and Israeli territory will cease. But Israeli sources said that it was obvious that tacit understandings had been reached by Israel and the PLO through Habib and officials of the United Nations. The commander of the U.N. truce-supervising organization, Gen. William Callahan, met with Habib before the U.S. envoy presented his proposals to Begin.

The vagueness of Habib's statement enables Israel to deny that it negotiated with the PLO, and at the same time provides the PLO with the opportunity to continue to officially deny any recognition of Israel's legitimacy.

When asked whether he regarded the agreement as a cease-fire, Uri Porat, Begin's press adviers, replied, "You can call it what you like. For me, it means silence in the north."

The agreement, which followed by several hours a Palestinian rocket attack on the northern Israeli town of Kiryat Shemona that killed a 65-year-old Israeli man and wounded 15 other civilians, also carried wide-ranging implications for the PLO's military wing, whose publicly stated purpose always has been to dismantle the modern state of Israel and return the Palestinian exile community to what was formerly Palestine.

While neither Begin nor Habib would disclose any details of the cease-fire agreement, Israeli sources siad it will effectively prevent the guerrillas from building up their military strength in southern Lebanon. Any indication of a buildup in the south, it was understood, will be interpreted by Israel as a violation of the agreement and the cease-fire will be abrogated.

Israeli sources said Lebanon will be allowed to rebuild bridges spanning the Litani and zaharani rivers that were destroyed in Israeli bombing raids, but said the bridges cannot be used for deploying Palestinian forces.

Although it was unclear from the statement what constitutes the "hostile actions" that Habib said will cease, Israeli sources said they interpreted the agreement as allowing the continuation of reconnaissance flights over Lebanon by the Israeli Air Force. Israel has maintained that these flights over Lebanon by the Israeli Air Force. Israel has maintained that these flights are essential to maintaining its security and preventing a surprise cross-border attack by Palestinian forces.

It was also unclear to what extent Syria, which maintains approximately 30,000 troops in Lebanon, might be a party to the agreement. The Habib statement said that "all hostile military actions" across the border would cease, which could be interpreted to mean that Israel is prohibited from attacking the Syrian is prohibited from attacking the Syrian surface-to-air missiles that were deployed in central Lebanon's Bekaa Valley on April 28, following the downing of two Syrian helicopters by Israeli planes.

Israeli sources stressed that the ambiguous phrashing of the agreement, which one official here called a "gentlemen's agreement," offered both sides a wide laititude of interpretation, and was drafted on the assumption that both sides wanted a cessation of hostilities.

Education Minister Zevulun Hammer, who said the agreement "involved everyone," said the cease-fire will enable Israel to test the Palestinians' intentions in the border area. When asked whether the agreement would preclude a Palestinian buildup in southern Lebanon during the absence of Israeli preemptive strikes, Hammer replied the understanding was that there "won't be any shooting or hostile operations."

Defense Minister Mordechai Zippori told reporters after the Cabinet session that it was important to note that the PLO was not mentioned in Habib's statement.

"Did you notice that it was not enought for Habib to talk [Lebanese President] Sarkis? He had to go to Saudi Arabia," Zippori said, referring to Habib's shuttle yesterday to Riyadh. That proved, Zippori said, the extent of Saudi Arabia's influence on the PLO.

Zippori said he was confident now that the 10 F16 aircraft destined for Israel, but held up after last Friday's Israeli air strike on PLO headquarters in Beirut, will be delivered soon.

Already, however, there were signs of discontent from the opposition Labor Party over Begin's handling of the Lebanese crisis.

Opposition leader Shimon Peres said that the PLO had "scored some points needlessly" as a result of Begin being drawn into a war of attrition in Lebanon, and that Israel had paid a "political price."

He said the two-week exchange of fire and the reaction in world opinion had damaged Israel's position abroad, and that a cease-fire should have been arranged days ago.

Israeli Housing Minister David Leavy, during a tour of kiryat Shemona, met with town officials tonight to discuss a return to normal for the 15,000 residents of the heavily shelled town.

Leavy promised the Kiryat Shmona residents that if the cease-fire breaks down because of Palestinian rocket fire, Israel will respond "massively" to the violation.