Prime Minister Benjamin Netanyahu has been tasked with forming a new Israeli government led by his right-wing Likud party after power-sharing talks reached a stalemate.

A statement from President Reuven Rivlin’s office said that Mr Netanyahu had been chosen as he had a marginally better chance of forming a government than his main rival. The prime minister now has 28 days to form a coalition.

“Assigning the responsibility for forming the government one of the candidates is in itself not the solution,” the president added.

“Doing so does not detract in any way whatsoever from the responsibility of both candidates, and all parties, to create the conditions for resolving the political impasse we find ourselves in.”

He finished by warning that ”the people do not want further elections.”

“The time we are in and size of the challenges ahead of us requires the leaders of this people to establish a government in Israel, a government for the people of Israel.”

Israel election 2019: Netanyahu battles to hang on to power Show all 20 1 /20 Israel election 2019: Netanyahu battles to hang on to power Israel election 2019: Netanyahu battles to hang on to power An Israeli man holding his dog casts his ballot EPA Israel election 2019: Netanyahu battles to hang on to power Chief Rabbi of the Vizhnitz (Hasidic Dynasty) Israel Hager (left), casts his ballot AFP/Getty Israel election 2019: Netanyahu battles to hang on to power Israeli Prime Minister Benjamin Netanyahu and his wife Sara casts their votes AFP/Getty Israel election 2019: Netanyahu battles to hang on to power A man takes a selfie with his mobile phone as he casts his ballot Reuters Israel election 2019: Netanyahu battles to hang on to power An Arab Israeli woman votes during Israel's parliamentary election at a polling station in Kafr Manda near Haifa on September 17, 2019. (Photo by Ahmad GHARABLI / AFP)AHMAD GHARABLI/AFP/Getty Images AHMAD GHARABLI AFP/Getty Israel election 2019: Netanyahu battles to hang on to power Israel's former defence minister Avigdor Lieberman and his wife Ella cast their ballots AFP/Getty Israel election 2019: Netanyahu battles to hang on to power Israeli children accompany their father during Israel's parliamentary election at a polling station AFP/Getty Israel election 2019: Netanyahu battles to hang on to power Blue and White party leader Benny Gantz and his wife Revital vote AP Israel election 2019: Netanyahu battles to hang on to power Israeli Prime Minister Benjamin prepares to vote AP Israel election 2019: Netanyahu battles to hang on to power A family votes in the settlement of Tekoa AP Israel election 2019: Netanyahu battles to hang on to power Ballots lies on a table AFP/Getty Israel election 2019: Netanyahu battles to hang on to power Israel's former justice minister Ayelet greets supporters after casting her ballot AFP/Getty Israel election 2019: Netanyahu battles to hang on to power An elderly ultra-Orthodox Jewish man casts his ballot at a voting station in the city of Bnei Brak during the Israeli parliamentary election on September 17, 2019. (Photo by Menahem KAHANA / AFP)MENAHEM KAHANA/AFP/Getty Images MENAHEM KAHANA AFP/Getty Israel election 2019: Netanyahu battles to hang on to power A mother takes a photograph of her daughter near a ballot box Reuters Israel election 2019: Netanyahu battles to hang on to power Children stand with their relative as they place his vote in a ballot box Reuters Israel election 2019: Netanyahu battles to hang on to power A woman holds her dog's leash as she prepares to vote Reuters Israel election 2019: Netanyahu battles to hang on to power An ultra Orthodox Jewish man casts his ballot during Israel's parliamentary election, at a polling station in Rosh Haayin, on September 17, 2019. (Photo by Jack GUEZ / AFP)JACK GUEZ/AFP/Getty Images JACK GUEZ AFP/Getty Israel election 2019: Netanyahu battles to hang on to power An Israeli woman casts her ballot during Israel's parliamentary election at a polling station in Tel Aviv on September 17, 2019. (Photo by GIL COHEN-MAGEN / AFP)GIL COHEN-MAGEN/AFP/Getty Images GIL COHEN-MAGEN AFP/Getty Israel election 2019: Netanyahu battles to hang on to power Israel's head of the Joint List alliance Ayman Odeh casts his ballot accompanied by his family AFP/Getty Israel election 2019: Netanyahu battles to hang on to power epa07847854 Ultra-Orthodox Jews register at polling station during the Israeli legislative elections, in Jerusalem, Israel, 17 September 2019. Israelis are heading to the polls for a second general election, following the prior elections in April 2019, to elect the 120 members of the 22nd Knesset, or parliament. According to the Israel Central Bureau of Statistics, about six million people are eligible to vote. EPA/ABIR SULTAN ABIR SULTAN EPA

The shock decision follows a day of fierce negotiations between the Likud leader and his rival Benny Gantz, from the centrist Blue and White Party.

Mr Rivlin’s announcement said that the meetings resulted in a deadlock with the sides not able to agree on a power-sharing deal.

Mr Netanyahu spoke to the president and emphasised the importance of a unity government and the threat posed by Iran, according to a statement released by his office.

He acknowledged that he did not have a better chance of forming a ruling coalition than his rival but that his “inability is a little smaller than Gantz’s inability”. Mr Netanyahu said that the pair had to form a government together.

“With the help of God and with the help of the citizens of Israel, and with your help, the president’s, we will form a broad, national unity government later on. I hope we succeed now,” he said.

He added that he would work towards a “joint leadership” but did not clarify whether that would mean a rotation deal where he would share the premiership with Mr Gantz and his co-leaders.

A spokeswoman for the Likud party told The Independent that the prime minister had not provided those details.

The final election results released earlier this week, Mr Gantz’s Blue and White Party won more seats in the Knesset than Likud, taking 33 out of 120. Mr Netanyahu’s party won 32 seats.

(AFP/Getty) (AFP)

But the incumbent prime minister secured the backing of more lawmakers than his rival, albeit with equally tight margins, with Mr Gantz securing 54 and Mr Netanyahu securing 55.

The question now is whether the prime minister will be able to form a coalition, or whether the deep divisions between Israel’s political parties will force another election, which would be the third in just one year.

The president has impressed upon both sides that an election should be avoided at all costs, telling both men: “People expect you to find a solution and to prevent further elections, even if it comes at a personal and even ideological cost.”

Mr Gantz’s party said that while they were “committed to the principle of unity” they could not enter into government if Mr Netanyahu is kept as leader, as he faces indictment in three corruption cases next month.

“[The party] treats the presidency with utmost respect and will accept any decision Rivlin makes. We come to the negotiating table with our principles, but also with an open mind and willful spirit”, a statement from Blue and White party said.

Mr Gantz added: “Blue and White, led by me, does not agree to sit in a government whose leader is facing a severe indictment. This issue, among a number of other critical factors, is more important to us than any delegation of ministerial posts or a rotation.”

Mr Netanyahu, who has signed a deal with smaller allies including ultra-Orthodox parties, will struggle to form a coalition.

Support free-thinking journalism and attend Independent events

Former ally Avigdor Lieberman criticised Mr Netanyahu and urged him to be more flexible in talks. He won eight seats in the election but has so far refused to join either side.

The ex-defence minister and now head of the ultranationalist Yisrael Beiteinu party had called for a secular unity government that excluded the prime minister’s religious allies, a demand Mr Netanyahu has rejected.

“Since the 9 April election we’ve seen Netanyahu’s unlimited flexibility and stunts, from his ‘Arabs are voting in droves’ cries to the frantic negotiations with the Arab Joint List,” he wrote on Facebook. ”Stop the blame game over who [would] be responsible for a third election – and perhaps we will heat the news, even before Rosh Hashanah, of a government, at least in principle.”

President Rivlin meanwhile added in his statement that he had offered several suggestions to help with the “legal complications” the country faced, in a veiled reference to Mr Netanyahu’s likely court proceedings.

He suggested the appointment of an interim prime minister who would take over if the premier was “unable to fulfil his role”, it also added that the law could be amended to lengthen a 100-day limit on the prime minister’s leave of absence.

Tamara Wittes, senior fellow in the Center for Middle East Policy at Brookings, told The Independent that the question will now be how strongly the various political parties will hold on to their campaign principles.

“Lieberman said he will only join a unity government with the two major parties. Does he mean it, or might Netanyahu be able to entice him back into a right-wing coalition? Blue and White said they would not sit in a government with Likud headed by Netanyahu — will they really insist on his departure as the price of unity, even if it means a third election?”, she said.

“The Likud MKs and all the parties to its right swore loyalty to Bibi as the head of their bloc. Do they mean it, or will they be willing to throw him over to avoid a third election? These are the questions.