Israel and Lebanon agreed today on an agenda for their negotiations and immediately began discussing its first item, the "termination of the state of war" between the two countries.

The agreement on the agenda was announced in the northern Israeli town of Qiryat Shemona where Israeli, Lebanese and U.S. negotiating teams met for the sixth time since the talks began on Dec. 28.

Avi Pazner, the chief spokesman of the Israeli Foreign Ministry, said Israel and Lebanon had agreed to "address concurrently" three main agenda items--termination of the state of war, security arrangements and a "framework for mutual relations."

He said topics to be discussed under the last item include liaison between the countries, ending of hostile propaganda, the movement of "goods, products and persons" across the Israeli-Lebanese border, the conditions of an Israeli troop withdrawal from Lebanon and "possible guarantees" of agreements reached in the negotiations.

"The agenda has incorporated the subjects proposed by the delegations of Israel and Lebanon," Pazner said. "All agree to address the items on the agenda open-mindedly, without commitment to the outcome of the negotiations. Each delegation may raise additional subjects to those on the agenda."

The announcement of the agenda agreement came shortly after U.S. special envoy Philip C. Habib met for 90 minutes here with Prime Minister Menachem Begin. Habib declined to comment as he left the meeting, during which, according to Begin's spokesman, Uri Porat, he delivered to Begin "a friendly letter from President Reagan."

Reagan's letter reportedly called on Begin to show more flexibility in the negotiations with Lebanon, which in the U.S. view must show signs of progress before there can be movement on the president's broader Middle East peace initiative.

The dispute over the wording and scope of the negotiating agenda, which had deadlocked the Israeli-Lebanese talks from the outset, led to mounting frustration in the Reagan administration and published speculation both here and in the United States that Begin's scheduled trip to Washington next month might be postponed as a sign of U.S. impatience with the pace of the talks.

In response to a question following today's meeting in Begin's office, Porat said an exact date for the trip has not been set.

Breaking of the agenda deadlock, however, is expected to ease the tension surrounding the negotiations even if the more difficult substantive issues involved in the talks are yet to be addressed.

The agreed agenda as it finally emerged today was based on the second of two U.S. proposals to end the stalemate and involved compromise by both Israel and Lebanon.

The Israelis had sought to make the establishment of "normal relations" between the countries the first order of business for the talks. They are demanding agreement on this and on the creation of a "security zone" in southern Lebanon to protect northern Israeli towns from attack in return for an Israeli troop withdrawal from its northern neighbor's territory.

Israel hopes that the talks will result in Lebanon becoming the second Arab state, after Egypt, to enter into a normal diplomatic relationship with the Jewish state.

But the Lebanese wanted the negotiations to begin with the troop withdrawal issue and made clear their reluctance to establish normal ties with Israel and risk estrangement from the Arab world and an adverse reaction from Lebanon's Moslem majority.

By referring to "mutual" rather than "normal" relations and by lumping under that category both the troop withdrawal issue and Israel's desire for agreements on trade, tourism and other aspects of its ties with Lebanon, the agreed agenda bridged these differences in the opening bargaining positions of the two sides.

The agreement to discuss the three main agenda items "concurrently" also finessed the question of which topic would take precedence in the negotiations. It remained unclear how the three agenda topics are to be handled in further negotiating sessions that begin Monday in the Beirut suburb of Khaldah but in the past Israeli officials have suggested that the six-member negotiating teams could be broken into subcommittees to handle various issues.

The Israeli government yesterday decided to seek certain unspecified changes in the U.S. proposal for a settlement of the agenda dispute, but these apparently did not pose a major problem at today's meeting. Following the announcement of the agenda agreement, both Israeli and Lebanese officials praised U.S. envoy Morris Draper, the head of the American negotiating team, for his role in fashioning the compromise.

Israeli officials also predicted that eventually there would be agreement on the substantive issues. "The process again proves there is no substitute for direct negotiations without prior conditions," Foreign Minister Yitzhak Shamir said.

Shamir called the atmosphere at today's meeting "friendly and cordial."

While today's talks were going on, Defense Minister Ariel Sharon was touring the northern Israeli region and after the announcement of the agenda agreement he called a news conference in Qiryat Shemona.

Sharon, who has portrayed himself as the chief architect of a still secret "understanding" with the Lebanese that he says led to the negotiations, said the agenda covers all the points he discussed in his talks with unnamed Lebanese officials.

"I see this as a first step toward discussions of the details and the essence of the sections" of the understanding, he said.

Observers expect the negotiations to be long and difficult. Their success hinges on the readiness of Syrian and Palestinian forces to leave Lebanon, which Israel demands as a condition of its withdrawal.