The conflicting positions of the various parties point up the difficulties facing anyone who tries to set up a coalition government in Israel. If Netanyahu relies only on the religious and hard-line parties, it means constant fights with the opposition over social programs. If he tries to team up with the centrists, it means battles with the ultra-Orthodox over subsidies, as well as internal sniping over concessions to the Palestinians.
Some predicted Netanyahu might even fail to form a government.
"Netanyahu's victory is a pyrrhic victory, and it is not clear he will be the next prime minister," said Israeli political analyst Yaron Ezrahi. "Netanyahu will face difficulty in constructing a viable coalition," Ezrahi said, estimating the life span of the next Israeli government at no more than 18 months.
Netanyahu has won praise at home for drawing the world's attention to Iran's suspect nuclear program and for keeping the economy on solid ground at a time of global turmoil.
Internationally, though, he repeatedly has clashed with allies over his handling of the peace process. Peace talks with the Palestinians have remained stalled throughout his term, in large part because of his continued construction of Jewish settlements in the West Bank and East Jerusalem.
Netanyahu himself has only grudgingly voiced conditional support for a Palestinian state, and his own party is now dominated by hard-liners who oppose that. A likely coalition partner, Naftali Bennett of the Jewish Home Party, which won 12 seats, has called for annexing large parts of the West Bank, the core of any future Palestinian state.
Palestinians viewed the election results grimly, seeing it as entrenching a pro-settlement government.
"Even if Netanyahu brings some center-left parties to his coalition, he will continue building in the settlements," said Mohammed Shtayeh, an aide to the Western-backed Palestinian President Mahmoud Abbas. "He said that clearly, and that is what we expect him to do."
In all, 32 parties ran in the election, and 11 won enough votes to enter the Knesset, according to the exit polls. Israelis vote by putting a slip with a party's initials into an envelope and dropping the envelope into a ballot box, so the process of counting all the votes by hand takes many hours.
Three hours after the polling stations closed, the official Election Commission had published results of only 15 percent out of about 3.5 million votes cast, and the breakdown was similar to the exit polls.
In a sign of the times, many Israelis advertised their voting choice by photographing their ballot slips and uploading them to Facebook.