Prime Minister Benjamin Netanyahu and his wife Sara. Photograph:( Reuters )
Likud party looked set to finish with a similar number of seats in parliament to his main rival, ex-military chief Benny Gantz's centrist Blue and White alliance.
Prime Minister Benjamin Netanyahu was projected to win a fifth term in office on Wednesday after nearly complete results from Israel's general election put him in position to form a right-wing coalition, media reports said.
The victory, despite corruption allegations against the 69-year-old premier, puts him on a path to become Israel's longest-serving prime minister later this year.
His Likud party looked set to finish with a similar number of seats in parliament to his main rival, ex-military chief Benny Gantz's centrist Blue and White alliance.
But with 97 per cent of the vote counted, results showed Likud and other rightwing parties allied to him with some 65 seats in the 120-seat parliament, media reports said.
The close race between the two main parties had led to uncertainty after polls closed on Tuesday night and exit surveys were released.
Both Netanyahu and Gantz claimed victory after the initial exit surveys that gave Blue and White the most seats.
But even then Netanyahu appeared best placed to form a coalition, with both parties, in any case, falling far short of an outright majority.
Netanyahu spoke in the early hours of Wednesday at Likud's post-election party in Tel Aviv and called it a "magnificent victory."
As he walked onto the stage to chanting crowds, he planted a kiss on the lips of his wife Sara before dramatically wiping lipstick from his face.
"It will be a right-wing government, but I will be prime minister for all," he said.
Earlier, while addressing cheering supporters who waived Israeli flags at an event hall in Tel Aviv, Gantz called it a "historic day."
"The president must give us the task of forming the next government since we are the biggest party," he said after initial exit polls.
The vote had long been expected to be close and lead to frantic negotiations to form a coalition, even with Netanyahu facing potential corruption charges.
"Things can change, but in any case the right-wing bloc won," Meshi Sivani, 52 and wearing a Likud t-shirt, said at Netanyahu's post-election party.
Shushan Levi, 61, called Gantz's performance an "enormous victory for an alliance so new."
"Once he announced he was entering politics, I followed him," he said at Blue and White's party.
"He was my commander in the army 40 years ago."
Gantz, a newcomer to politics, mounted a strong challenge to the veteran prime minister by brandishing his security credentials while pledging to undo damage he says Netanyahu has inflicted on the country with divisive politics.
The election was in many ways a referendum on the 69-year-old premier who has built a reputation as the guarantor of the country's security and economic growth, but whose populism and alleged corruption have left many ready for change.
He engaged in populist rhetoric that critics said amounted to the demonisation of Arab Israelis and others.
Netanyahu faced further criticism on election day when members of his Likud party brought small cameras into polling stations in Arab areas.
Arab politicians called it an attempt at intimidation, while Netanyahu said cameras would prevent fraud.
True to form, Netanyahu issued a deeply controversial pledge only three days before the election, saying he planned to annex Jewish settlements in the occupied West Bank should he win.
Extending Israeli sovereignty on a large-scale in the West Bank could be the death knell to already fading hopes for a two-state solution with the Palestinians.
It is a move long-sought by Israel's far right.