Prime Minister Benjamin Netanyahu has been nominated to try to form Israel’s next government, the Israeli president’s office announced Wednesday, offering the longtime leader a political lifeline even as he faces a looming indictment for corruption.President Reuven Rivlin chose Mr. Netanyahu of the conservative Likud party over his chief opponent, Benny Gantz, a former military chief and the leader of the centrist Blue and White party. The Sept. 17 election left the sides essentially tied.Mr. Netanyahu faces a stiff challenge: He has 28 days to assemble a majority of at least 61 seats in Parliament and has no clear path to that number. The parties that have endorsed his bid for another term won 55 seats.He also faces possible indictments in three corruption cases, and a special hearing with the attorney general has been scheduled for next Wednesday.It was the second time Mr. Netanyahu, Israel’s longest-serving prime minister, has been given the chance to form a government in five months. He won a plurality in the previous election in April but failed to assemble a majority coalition in its aftermath, leading to a repeat election this month.Mr. Rivlin had been pushing Mr. Netanyahu and Mr. Gantz to forge a broad unity government including both their parties. The two parties met on Tuesday to discuss the possibility but failed to reach an agreement.Each had agreed to the idea in principle, but on very different terms. Mr. Gantz said before the election that he would not join a government with Likud so long as its leader faced indictment, and that he wanted to form a broad, secular coalition, excluding ultra-Orthodox parties.That left the hard-line nationalist party led by Avigdor Liberman, with eight seats, in the role of kingmaker. Mr. Liberman has advocated a unity government with Blue and White and Likud, but without Mr. Netanyahu’s ultra-Orthodox coalition partners.Mr. Netanyahu had pledged to stick with his former coalition partners in right-wing and religious parties.If Mr. Netanyahu fails to assemble a majority coalition in 28 days, the president could grant him a 14-day extension. If Mr. Netanyahu still fails, as he did in May, the mantle could be passed to Mr. Gantz, who will then have another 28 days to try to form a government.Mr. Gantz won the endorsement of 54 lawmakers, one less than Mr. Netanyahu, and he too has no clear path to a majority.