Mr. Netanyahu’s Likud-Beiteinu ticket had 31 seats, followed by 19 for Mr. Lapid’s Yesh Atid and 15 for Labor. The ultra-Orthodox Shas party and the Jewish Home, which is dominated by religious-Zionists and advocates annexing the West Bank, each garnered 11 seats. Tzipi Livni’s Hatnua and the left-wing, pro-peace Meretz each got six, while the three Arab parties totaled 12. Kadima which won the most parliament seats – 28 – in the last election, had 2, having collapsed after briefly joining the Netanyahu coalition last year but failing to fulfill its promises. Votes of soldiers and a few other groups had yet to be counted and could change the balance.

The prime minister called Mr. Lapid shortly after the polls closed at 10 p.m. Tuesday and, according to Israeli television reports, told him that they had great things to do together for the country. In his speech to a rowdy crowd of supporters here Wednesday morning, he said, “I see many partners.”

Mr. Lapid indicated he was open to working with Mr. Netanyahu, saying the only way to face Israel’s challenges was “together.” But he added: “What is good for Israel is not in the possession of the right, and nor is it in the possession of the left. It lies in the possibility of creating here a real and decent center.”

The results were a blow to the prime minister, whose aggressive push to expand Jewish settlements in East Jerusalem and the West Bank has led to international condemnation and strained relations with Washington. The support for Mr. Lapid and Labor showed voters responded strongly to an emphasis on domestic, socioeconomic issues that brought 500,000 people to the streets of Tel Aviv in the summer of 2011.

“Israelis are asking for a moderate coalition,” said Marcus Sheff, executive director of the Israel Project, an advocacy group that conducts research on public opinion. “Israel’s middle class wasn’t asleep as people assumed. The embers of the social protest are still strong.”

Erel Margalit, a venture capitalist and first-time candidate who was elected to Parliament on Labor’s list, described the high turnout as a “protest vote” and “a clear demonstration of how many Israelis feel like something needs to be done and something needs to change.”