Israeli Prime Minister Benjamin Netanyahu's ruling Likud party scored a resounding victory in the country's election, final results showed Wednesday, after a tight race that had put in jeopardy his long hold on power.

With nearly all votes counted, Likud appeared to have earned 30 of the Knesset's 120 seats and was in a position to build with relative ease a coalition government with its nationalist, religious and ultra-Orthodox Jewish allies. Netanyahu declared victory late Tuesday after the vote appeared to give him the upper hand.

In a statement released on Twitter, he said that "against all odds," Likud and the nationalist camp secured a "great victory."

Initial exit polls showed Likud deadlocked with the center-left Zionist Union. But even before final results were tallied early Wednesday, poll results indicated that Netanyahu would have an easier time cobbling together a majority coalition with hard-line and religious allies.

Netanyahu said he already begun to call potential partners.

Isaac Herzog, whose Zionist Union party won 24 seats, called to congratulate Netanyahu. Herzog, who just days ago appeared poised to win, signaled that he would be heading the opposition. Speaking to reporters outside his Tel Aviv home, he said that Israel now needed "another voice, a voice that offers an alternative and a voice that tells it the truth."

On Wednesday, 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 Palestinian negotiator Saeb Erakat told Agence France-Presse.

Since the parties all fall short of the required 61-seat majority in the Knesset, the country will now head into weeks of negotiations amid efforts to form a coalition.

Exit polls showed that centrist newcomer Moshe Kahlon, a Likud breakaway, could have enough seats to determine who will be the next prime minister. He has not said whether he favors Netanyahu or Herzog.

Israel is divided between two major blocs of voters — right-wing and religious parties that tend to take a hard line toward the Palestinians, and dovish parties focused on establishing a Palestinian state as part of a peace agreement.

The left wing appeared to have slightly more seats, but that count includes seats held by the new Arab List — an alliance of Arab-majority political parties in Israel — that has said it will not sit in a coalition.

That gives Netanyahu and his right-wing allies the upper hand. But Kahlon, who has already demanded control of the finance ministry, is likely to drive a hard bargain before agreeing to join the government.

The vote was largely seen as a referendum on Netanyahu. While he focused his campaign almost entirely on security matters, his opponents, including Kahlon, turned their attention to bread-and-butter issues and the country's high cost of living.

Channel 2 TV commentator Amnon Abramovitch predicted that Netanyahu would form a rickety coalition and that "he will be a prisoner in his own government."