Prime Minister Benjamin Netanyahu and his hard-line allies fared far worse than expected in a parliamentary election Tuesday, likely forcing him to reach across the aisle to court a popular political newcomer to cobble together a new coalition.

While Netanyahu appeared positioned to serve a third term as prime minister, the results marked a major setback for his policies and could force him to make new concessions to restart long-stalled peace talks with the Palestinians.

More than 99 percent of the votes had been counted by Wednesday morning and results showed the hawkish and dovish blocs were split about evenly.

Netanyahu's most likely partner was Yesh Atid, or There is a Future, a party headed by political newcomer Yair Lapid that showed surprising strength. Lapid has said he would only join a government committed to sweeping economic changes and a resumption of peace talks with the Palestinians.

Addressing his supporters early Wednesday, Netanyahu vowed to form as broad a coalition as possible. He said the next government would be built on principles that include reforming the contentious system of granting draft exemptions to ultra-Orthodox Jewish men and the pursuit of a "genuine peace" with the Palestinians. He did not elaborate, but the message seemed aimed at Lapid.

Shortly after the results were announced, Netanyahu called Lapid and offered to work together. "We have the opportunity to do great things together," Netanyahu was quoted as saying by Likud officials.

Netanyahu's Likud-Yisrael Beitenu alliance was set to capture about 31 of the 120 seats, significantly fewer than the 42 it held in the outgoing parliament and below the forecasts of recent polls.

With his traditional allies of nationalist and religious parties, Netanyahu could put together a shaky majority of 61 seats, results showed. But it would be virtually impossible to keep such a narrow coalition intact, though it was possible he could take an additional seat or two as numbers trickled in throughout the night.

The results capped a lackluster campaign in which peacemaking with the Palestinians, traditionally the dominant issue in Israeli politics, was pushed aside. Netanyahu portrayed himself as the only candidate capable of leading Israel at a turbulent time, while the fragmented opposition targeted him on domestic economic issues.

Netanyahu's goal of a broader coalition will force him to make some difficult decisions. Concessions to Lapid, for instance, will alienate his religious allies. In an interview last week with The Associated Press, Lapid said he would not be a "fig leaf" for a hard-line, extremist agenda.

Lapid's performance was the biggest surprise of the election. The one-time TV talk show host and son of a former Cabinet minister was poised to win 19 seats, giving him the second-largest faction in parliament.

Presenting himself as the defender of the middle class, Lapid vowed to take on Israel's high cost of living and to end the contentious system of subsidies and draft exemptions granted to ultra-Orthodox Jews while they pursue religious studies. The expensive system has bred widespread resentment among the Israeli mainstream.

Thanks to his strong performance, Lapid is now in a position to serve as the kingmaker of the next government. He will likely seek a senior Cabinet post and other concessions.

Yaakov Peri, a member of Lapid's party, said it would not join unless the government pledges to begin drafting the ultra-Orthodox into the military, lowers the country's high cost of living and returns to peace talks. "We have red lines. We won't cross those red lines, even if it will cost us sitting in the opposition," Peri told Channel 2 TV.

Addressing his supporters, a beaming Lapid was noncommittal, calling only for a broad government with moderates from left and right. "Israelis said no to the politics of fear and hatred," he said. "And they said no to extremism and anti-democracy."

There was even a distant possibility of Lapid and more dovish parties teaming up to block Netanyahu from forming a majority.

"It could be that this evening is the beginning for a big chance to create an alternative government to the Netanyahu government," said Shelly Yachimovich, leader of the Labor Party, which won 15 seats on a platform pledging to narrow the gaps between rich and poor.

Although that seemed unlikely, Netanyahu clearly emerged from the election in a weakened state.

"We expected more seats in the parliament," Danny Danon, a senior Likud member, told the AP. "But the bottom line is that Benjamin Netanyahu is the next prime minister of Israel."

Under Israel's system of proportional representation, seats in the 120-member parliament are allocated according to the percentage of votes a party gets. As leader of the largest party, Netanyahu is in the best position to form a coalition and be prime minister.

The results were shocking, given the steady stream of recent opinion polls forecasting a solid victory by Netanyahu and his allies. Netanyahu appeared to suffer because of his close ties to the ultra-Orthodox and perhaps from complacency. Many voters chose smaller parties, believing a Netanyahu victory was inevitable.

Tensions with the United States, Israel's most important ally, also may have factored into the thinking. President Barack Obama was quoted last week as saying that Netanyahu was undermining Israel's own interests by continuing to build Jewish settlements on occupied lands.

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. In his speech, Netanyahu said that preventing Iran from developing nuclear weapons would remain his top priority.

But internationally, he has repeatedly 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. The Palestinians want a halt to settlement construction before talks begin. Netanyahu says talks must start without any preconditions.

Obama has had a turbulent relationship with Netanyahu, and the two leaders could find themselves on a collision course in their new terms. The Obama administration said that regardless of the results of the election, the U.S. approach to the conflict would not change.

"We will continue to make clear that only through direct negotiations can the Palestinians and the Israelis ... achieve the peace they both deserve," said White House spokesman Jay Carney.

In London, British Foreign Secretary William Hague urged Obama to make the Middle East peace process his top priority. "We are approaching the last chance to bring about such a solution," Hague warned.

Netanyahu himself has only grudgingly voiced conditional support for a Palestinian state, and his own party is now dominated by hard-liners who oppose even that. A potential coalition partner, Naftali Bennett of the Jewish Home Party, which won 11 seats, has called for annexing large parts of the West Bank, the core of any future Palestinian state.

While Lapid advocates a softer line toward the Palestinians, his campaign focused on economic issues and it remains unclear how hard he will push Netanyahu on the issue.

Lapid's positions also fall short of Palestinian demands. Most critically, he opposes any division of Jerusalem. The Palestinians seek the West Bank, Gaza Strip and east Jerusalem, territories captured by Israel in the 1967 Mideast war, for a future state.

The Palestinians viewed the election results grimly.

"If he brings Lapid into his government, this would improve the image of the Netanyahu government in the eyes of the world. But it won't make him stop building settlements, particularly in east Jerusalem," said Mohammed Ishtayeh, a senior adviser to President Mahmoud Abbas.

In all, 32 parties contested the election, and 12 won enough votes to enter parliament, according to the exit polls. Netanyahu now has up to six weeks to form a government.