Binyamin Netanyahu suffered a major setback in Israel's general election as results gave the narrowest of victories for the rightwing-religious block and a surprisingly strong showing for a new centrist party formed last year, forcing the prime minister to say he will seek a broad coalition to govern Israel.

Right wing and allied Orthodox religious parties won half the seats in the Israeli parliament, presenting Netanyahu with a tough political challenge to put together a stable coalition.

Netanyahu remains on course to continue as prime minister, as his rightwing electoral alliance, Likud-Beiteinu, is the biggest party after winning 31 of 120 seats in the next parliament. But it was a sharp drop from the present combined total of 42 for the two parties.

Yesh Atid, a new centrist party led by the former television personality Yair Lapid, won 19 seats. It concentrated its election campaign on socio-economic issues and removing the exemption for military service for ultra-orthodox Jews.

Netanyahu called Lapid, whose unexpected success hands him a pivotal role in coalition negotiations, as the final results came in to discuss a potential government.

Likud officials quoted the Israeli prime minister as telling Lapid: "We have the opportunity to do great things together".

But Netanyahu was also putting out feelers to ultra-Orthodox parties which could prove vital in putting together a government, saying he would open coalition talks with them on Thursday.

Final results could shift, although not dramatically, later in the week after votes from serving members of the military are counted.

Two out of three Israelis voted in Tuesday's election, a slightly higher proportion than in the previous two elections, surprising observers who had predicted a fall in turnout.

In a speech at his election headquarters in Tel Aviv, Netanyahu said: "I believe the election results are an opportunity to make changes that the citizens of Israel are hoping for and that will serve all of Israel's citizens. I intend on leading these changes, and to this end we must form as wide a coalition as possible, and I have already begun talks to that end this evening."

Lapid told campaign workers in Tel Aviv: "We must now … find the way to work together to find real solutions for real people. I call on the leaders of the political establishment to work with me together, to the best they can, to form as broad a government as possible that will contain in it the moderate forces from the left and right, the right and left, so that we will truly be able to bring about real change."

Dov Lipman, who won a seat for Yesh Atid, said: "This is a very clear statement that the people of Israel want to see a different direction. We will get the country back on track."

Labour was the third largest party, with 15 seats. Party leader Shelly Yachimovich said in a statement: "There is no doubt we are watching a political drama unfold before our eyes … There is a high chance of a dramatic change, and of the end of the Netanyahu coalition." She said she intended to attempt to "form a coalition on an economic-social basis that will also push the peace process forward." It seems unlikely Yachimovich could present a credible alternative to Netanyahu's claim to the premiership.

Erel Margalit of Labour said the results indicated "a protest vote against Netanyahu" and that the huge social justice protests that swept Israel 18 months ago "were not a fringe phenomena. Perhaps some of it is moving from the streets into the political arena".

The ultra-nationalist Jewish Home, which showed strongly in opinion polls during the campaign, was at 11 seats, the same as the ultra-orthodox party Shas. The leftist party Meretz made an unexpectedly strong showing, with six seats, more than doubling its current presence.

Speculation about the composition of the next coalition government intensified as the results came in. Israel's electoral system of proportional representation has ensured no single party has gained an absolute majority since the creation of the state almost 65 years ago. Negotiations are expected to last several weeks.

As the leader of the biggest party, Netanyahu will be first in line to assemble a coalition. Although Netanyahu's natural partners are the smaller rightwing and religious parties, he is likely to be keen to include Yesh Atid and possibly Hatnua, which is led by former foreign minister Tzipi Livni and won seven seats. However, Livni's insistence on a return to meaningful negotiations with the Palestinians could deter Netanyahu from inviting her join him.

Three parties mostly supported by Israeli Arabs had 12 seats between them. Although they are regarded as part of the left bloc in the Knesset, it is unlikely they would be part of any coalition government.

Yehuda Ben Meir of the Institute of National Security Studies, said: "The story of this election is a slight move to the centre, and above all the possibility of Netanyahu forming a coalition only with his 'natural partners' does not exist. He is definitely going to work for a wider coalition."

According to Ari Shavit of the liberal newspaper Haaretz, Netanyahu had failed to consolidate or advance his party's position. "While in the past he was given poor cards and played them well, this time he had the best cards and played them badly. This was a lesson in how not to run a campaign."

Kadima, which was the biggest party in the last parliament with 28 seats, saw its support plummet and only just crossed the threshold of votes needed to win two seats, according to the partial results.

In Washington, the Obama administration said it is waiting to see the make up of the new government and its policies on peace with the Palestinians. But the White House spokesman, Jay Carney, said there would be no change in US policy.

"The United States remains committed, as it has been for a long time, to working with the parties to press for the goal of a two-state solution. That has not changed and it will not change," he said.