Israeli Prime Minister Benjamin Netanyahu beat the odds on Wednesday to win a resounding election victory that will likely deepen tensions with the Palestinians and the West.
With nearly all of the votes counted, his rightwing Likud party was seen taking 30 of the Knesset's 120 seats, with the centre-left Zionist Union a distant second on 24.
Exit polls had put the two parties neck-and-neck with 27 seats each but the picture changed dramatically through the night as the votes were counted.
"Against all odds we achieved a great victory for the Likud ... for the national camp ... for our people of Israel," the premier said in a victory speech in Tel Aviv.
Likud activists in Tel Aviv celebrated their victory by dancing late into the night.
Zionist Union leader Isaac Herzog conceded defeat and congratulated Netanyahu on winning a third consecutive term.
"A few minutes ago, I spoke with Prime Minister Benjamin Netanyahu. I congratulated him on his achievement, and wished him luck," he said, brushing off questions about possible coalition alliances.
Netanyahu pledged to establish a new government within weeks and said he had already spoken with rightwing and religious party leaders whose support he will need to form a majority coalition.
- 'Netanyahu has done it' -
"The prime minister intends to begin forming the government immediately in order to finish the task within two to three weeks," his party said.
Netanyahu had put security at the forefront of his campaign, arguing he is the only one capable of protecting Israel from an Iranian nuclear threat and vowing never to allow the Palestinians to establish a capital in east Jerusalem.
In response, the Palestinians vowed to step up their diplomatic campaign for statehood.
"It is clear that Prime Minister Benjamin Netanyahu will form the next government, so we say clearly that we will go to the International Criminal Court in the Hague and we will speed up, pursue and intensify" all diplomatic efforts, chief negotiator Saeb Erakat told AFP.
In a last-minute appeal to the far-right just hours before the vote, Netanyahu ruled out the establishment of a Palestinian state if reelected, effectively reneging on his 2009 endorsement of a two-state solution.
Herzog has repeatedly called for the creation of a Palestinian state alongside Israel.
And on election day itself, Netanyahu made a last-minute appeal to his supporters to go to the polls to counter a high turnout among Arab Israelis.
"The rule of the rightwing is in danger. Arab voters are going to the polls in droves!" he said in a video on Facebook. "Go to the polling stations! Vote Likud!"
The count showed the Joint List which groups Israel's main Arab parties taking third place with 14 seats.
Likud had been trailing the Zionist Union by up to four seats in surveys in the week leading up to the vote, which was seen as a referendum on his premiership.
Netanyahu is certain to be the party leader to be asked by President Reuven Rivlin to form a government after the official results are published -- likely on Thursday, election officials said.
"Netanyahu has done it. He has managed to catch up in the final lap," said Claude Klein, a specialist in constitutional law at Jerusalem's Hebrew University.
"On paper, Isaac Herzog has no chance of putting together a majority which would depend on the support of the Arab List which includes openly anti-Zionist MPs."
Under Israel's electoral system, the prime minister is not the leader of the party that gains most seats but whoever can build a coalition commanding a majority of at least 61 seats in parliament.
Moshe Kahlon, a popular former Likud minister whose newly-formed Kulanu party won 10 seats, is now in the position of kingmaker.
A total of 4,017,235 people cast their ballots out of 5.8 million who were eligible to vote, election committee statistics showed.
That 71.8 percent turnout compared with 67.8 percent in the last election in 2013.
"Israel has serious problems, and only a rightwing leader can handle them," said a Jerusalem voter who gave his name only as Yehoshua.
"The only prime minister who can do this is Bibi."
But others had hoped to see the back of him.
"I'd like to see Netanyahu disappear for many, many years," said Shulamit Laron.
"I hope for change, of course, but I doubt things will change."