After a meeting with Israel's President Reuven Rivlin on Monday, Prime Minister Benjamin Netanyahu and Blue and White party leader Benny Gantz agreed to begin talks toward forming a unity government to break the country's current political deadlock.

The leaders of the country’s two largest political parties met for more than two hours at the president’s home in Jerusalem, first with Rivlin and then alone, The Times of Israel reported, adding that the discussion focused on who would lead a possible joint government.

The deadlock has threatened to push Israel into months of limbo and could lead to an unprecedented third election within a year. A unity deal between the large parties could be the only way out of the impasse.

ISRAEL'S ARAB LAWMAKERS BACK NETANYAHU'S RIVAL, GANTZ, FOR PRIME MINISTER

Gantz, a former military chief whose centrist alliance took 33 seats in Tuesday’s election, was looking to unseat Netanyahu and his conservative Likud party, which captured 31 seats. Neither party won enough seats together with their allied parties to secure the required 61-seat majority, with a total of 55 lawmakers throwing their support behind Netanyahu and 54 favoring Gantz.

On Monday night, neither Netanyahu, who has ruled the country for the past decade, nor Gantz commented as Rivlin brought them together for a photo at the beginning of the meeting.

After a meeting with Israel's President Reuven Rivlin, center, Prime Minister Benjamin Netanyahu, left, and Blue and White party leader Benny Gantz agreed to begin talks toward forming a unity government. (Haim Zach/Israel Government Press Office)

“People expect you to find a solution and to prevent further elections, even if it comes at a personal and even ideological cost,” Rivlin told the two leaders. “This is not the time to exclude people.”

In a joint statement after the meeting, the sides said that negotiators would continue the talks on Tuesday and that the president had invited Gantz and Netanyahu back to meet with him on Wednesday evening. The two parties did not provide details about Monday night’s talks.

Rivlin’s office reportedly said in a statement that the sit-down marked a “significant step forward.”

Israel’s president was expected to propose a rotation agreement wherein the two leaders would switch off as prime minister, though the order of such a deal remained unclear, The Times of Israel reported, adding that Gantz had insisted he would rule first under a rotational deal.

NETANYAHU'S CHIEF RIVAL, GANTZ, REJECTS PM'S APPEAL FOR UNITY GOVERNMENT IN ISRAEL

Later Monday, Gantz said “there was much talk about unity” at the meeting, but stressed that he would stick to his principles, vowing to form a “secular” government.

He added, “The public has chosen change and we have no intention of relinquishing our lead, our principles and our natural partners in this path.”

Maverick politician Avigdor Liberman, the head of the mid-sized Yisrael Beitenu party, has been considered the key power broker, considering the eight seats his party captured. Netanyahu had been unable to form a coalition without Liberman's support after the election five months earlier, triggering last week's elections. The former Netanyahu ally-turned-rival objected to what he called excessive influence by the religious parties.

This time around, Liberman has refused to endorse either candidate and demanded they join him in a broad, secular unity government.

Both Netanyahu and Gantz have expressed support for a unity deal between their parties, but there have been deep differences between them.

Gantz has said he will not partner with Likud as long as Netanyahu was in control, citing the prime minister’s legal issues. Israel’s attorney general has recommended charging Netanyahu with a series of corruption-related charges and is expected to make a final decision following a hearing early next month.

NETANYAHU APPEALS TO DIRECT RIVAL TO FORM UNITY GOVERNMENT AS PROSPECT OF THIRD ELECTION LOOMS

Meantime, Netanyahu has moved to remain at the helm of a unity government and signed a deal with smaller allies, including ultra-Orthodox parties, to negotiate as a “bloc,” which signified he will not enter a government without them.

Following Monday's talks with Gantz, Netanyahu reportedly spoke with the heads of his allied parties saying he had stressed to Gantz that he was representing the “entire nationalist camp.”

He added, “I’m committed to what I promised you,” as The Times of Israel reported.

Liberman, meanwhile, has refused to sit in a coalition with the ultra-Orthodox parties.

Gantz met with Liberman earlier on Monday, after which Liberman said a unity government was a done deal, adding that the order of the rotation still needed to be figured out, the newspaper added.

Over the past two days, Rivlin has been meeting with all the parliamentary factions before choosing his candidate for prime minister, the person he'd think would be most likely to form a coalition successfully.

By Oct. 2, Israel’s president is expected to designate either Gantz or Netanyahu with the task of trying to form a government.

Rivlin’s pick would have up to six weeks to assemble a government and if that person failed, the president could appoint another candidate who would get up to four weeks. If that person were to be unsuccessful, new elections would be triggered once again.

During Rivlin’s consultations, most parties made their expected recommendations with nationalist and religious parties supporting Netanyahu’s Likud, while two more centrist parties sided with Gantz.

In a break from custom, a coalition of Arab parties endorsed Gantz, marking the first time in nearly three decades that the group had recommended a candidate. Arab parties typically have withheld from endorsing a candidate because they have pushed back against any suggestion they were legitimizing Israeli policies, which they have claimed discriminated against Palestinians. Arab leaders said they made their decision with the goal of toppling Netanyahu.

CLICK HERE FOR THE FOX NEWS APP

Three Arab lawmakers said Monday they were withdrawing their endorsements for Gantz, which left him with less support than Netanyahu.

The Associated Press contributed to this report.