Leaders of Israel's two main political blocs, who just two days ago predicted they were nearing agreement on a joint government of national unity, tonight said serious obstacles had arisen in their efforts to end the country's five-week-old political deadlock.

Labor party officials characterized the talks as being near collapse and said that they would try again to persuade some uncommitted minority parties to join them in a narrow-based coalition led by Labor that would exclude the Likud bloc. Should they not succeed in forming such a government, they said, they would press for new parliamentary elections to be held as soon as possible.

Labor Alignment leader Shimon Peres, emerging from two hours of talks with his principal political rival, Prime Minister Yitzhak Shamir of the Likud, told reporters, "We have found our differences to be very serious ones and we shall try by different contacts to see if we can overcome them."

Shamir echoed Peres' terse statement, saying, "I am always optimistic but . . . we have seen that there are some very important obstacles and we have to find a way to overcome them."

Neither would identify the problems that had arisen, but sources from both parties indicated that Shamir's Likud colleagues had balked at proposals that Shamir appeared to have accepted in his talks with Peres last week. Those included a 50-month rotation of the office of prime minister between Peres and Shamir, with Peres taking the first 25-month term, and an equal division of Cabinet positions, with Labor guaranteed the Defense Ministry and Likud Foreign Affairs and Finance.

Observers said it was significant that tonight, in contrast to Friday's upbeat press conference, the two men did not announce a date for their next session. Shamir said only that he and Peres would make "an additional attempt" to resolve their differences "in the next few days." He also said that he was "still committed to forming a government of national unity."

Peres, whose coalition won 44 seats to 41 for the Likud in the inconclusive July 23 elections, has two more weeks left in the mandate given him by President Chaim Herzog to form a government. Labor is thought to have the firm support of 54 members of the 120-seat parliament, seven shy of a majority.

Labor officials blamed Likud leaders for the latest crisis in the unity talks, saying they undercut Shamir and forced him to retreat from agreements he had reached with Peres last week.

"To the extent to which the agreements that were realized last week are not carried out, it appears the Likud is trying to sabotage a national unity government," Avraham Katz-Oz, a Labor legislator, told Israeli television tonight. Katz-Oz, who is in charge of Labor's negotiations with the four-seat National Religious Party, which Labor has been trying to woo into a narrow governing coalition, said he would meet again with party leaders Monday.

Likud sources denied Labor's version of last week's understandings, saying Shamir had never reached firm agreement with Peres on these issues. They said Labor had exaggerated last week's agreement in order to make Likud the scapegoat for any breakdown in the talks.

Nonetheless, it appeared that Shamir, who on Friday said a final pact betwen the two sides was "very close," had been forced to back away tonight. Shamir said he had brought "new suggestions" to tonight's session, which followed a 3 1/2-hour meeting between Shamir and Likud Cabinet ministers. He would not describe those "suggestions," which Labor sources claimed were new conditions, but said they included structural and ideological matters.

Likud sources outlined several problems they had with the rotation of the prime minister's job as reportedly agreed upon last week. They said they felt that Shamir should be the first prime minister, rather than Peres, or that the period of rotation should be reduced to one year each.

They also said they feared that because there are no provisions or precedent in Israeli law for such a rotation, Labor could simply back out of the agreement after Peres' term had ended and force new elections that would deny Likud its turn to hold the prime minister's post.

Likud leaders also objected to Labor's insistence on keeping the Defense Ministry, considered Israel's most important Cabinet position, for the entire term of the national unity government. They argued that if Peres were to be the first prime minister, the Likud should hold the Defense Ministry for at least that period.

Peres has publicly promised the post to former prime minister Yitzhak Rabin, his longtime party rival. Many Likud members object to Rabin's holding the position because of his vocal opposition to new Jewish settlements on the occupied West Bank. They were said to be insisting that, at the very least, authority over the settlements be transferred from Defense to a Likud-controlled ministry as part of the price for accepting Rabin as defense minister.

Peres reportedly was willing to name a Likud leader such as present Defense Minister Moshe Arens as Rabin's deputy but would not agree to curtailing the ministry's functions or denying it to Rabin, a move that could set off political warfare inside the Labor Alignment.