JERUSALEM - Israeli Prime Minister Benjamin Netanyahu appeared to fend off a strong challenge from the country's opposition leader in parliamentary elections Tuesday, emerging from an acrimonious campaign in a slightly better position to form Israel's next government.
But with the sides nearly evenly divided, a victory by Netanyahu's Likud Party still was not guaranteed. His chief rival, Isaac Herzog of the Zionist Union, said he would make "every effort" to form a government, and an upstart centrist party led by a former Netanyahu ally-turned-rival was set to be the kingmaker. The country now heads into what could be weeks of negotiations over the makeup of the next coalition.
Netanyahu and Herzog will compete for a chance to form a coalition that commands a majority in the 120-seat parliament, a daunting task in Israel's fractured political landscape.
Netanyahu appeared to have a better chance of cobbling together a government with right-wing and religious parties that he calls his "natural allies." Herzog would have to appeal to more ideologically diverse parties.
Either will likely need the support of Moshe Kahlon, whose new Kulanu party captured nine or 10 seats, according to polls. Kahlon, whose campaign focused almost entirely on bread-and-butter economic issues, refused to take sides.
"I am loyal to my way," he told his supporters, saying he would work to form a government committed to social justice.
The election was widely seen as a referendum on Netanyahu, who has governed the country for the last six years, and recent opinion polls had given Herzog a slight lead.
As the results were announced on the nation's three major TV stations, celebrations erupted at Likud's campaign headquarters in Tel Aviv.
"Against all the odds we obtained a great victory for the Likud," Netanyahu told the gathering. "Now we must form a strong and stable government that will ensure Israel's security and welfare," he added, in comments aimed at Kahlon.
Kahlon said he had already been in touch with all other nationalist parties in hopes of quickly forming a coalition.
Netanyahu focused his campaign on security issues, while his opponents instead pledged to address the country's high cost of living and accused the leader of being out of touch with everyday people. Herzog also promised to repair tattered ties with the United States and to revive peace efforts with the Palestinians.
At a rally of his supporters, Herzog vowed to do his utmost to form a government and said he too had reached out to potential coalition partners. In a nod to Kahlon, he said he was committed to forming a "real social reconciliation government" committed to lowering the country's cost of living and reducing gaps between rich and poor.
Netanyahu's return to power would likely spell trouble for Mideast peace efforts and could further escalate tensions with the United States.
Netanyahu, who has a testy relationship with President Obama, took a sharp turn to the right in the final days of the campaign, staking out a series of hard-line positions that will put him at odds with the international community.
In a dramatic policy reversal, he said he now opposes the creation of a Palestinian state - a key policy goal of the White House and the international community. He also promised to expand construction in Jewish areas of East Jerusalem, the section of the city claimed by the Palestinians as their capital.
Netanyahu infuriated the White House early this month when he delivered a speech to the U.S. Congress criticizing an emerging nuclear deal with Iran. The speech was arranged with Republican leaders and not coordinated with the White House ahead of time.
In Washington, White House spokesman Josh Earnest said Obama was confident that strong U.S.-Israeli ties would endure far beyond the election regardless of the victor.
The Palestinians, fed up after years of deadlock with Netanyahu, are now likely to press ahead with their attempts to bring war-crimes charges against Israel in the International Criminal Court.
"What Netanyahu is doing and stating are war crimes and if the international community wants peace it should make Netanyahu accountable for his acts," said Palestinian official Saeb Erekat. He said the Palestinian leadership would meet Thursday to discuss its next steps.
Exit polls on Israel's three main TV stations showed Likud and the Zionist Union in a near deadlock. Channels One and 10 gave Likud a 27-26 lead in the 120-seat parliament, while Channel 2 gave Likud a 28-27 edge. That breakdown could change as final results pour in Wednesday.
Under Israel's fragmented electoral system, either Netanyahu or Herzog will have to court potential partners to secure a 61-seat majority.
Herzog could potentially try to build a coalition that would rely on support from a new Arab alliance that captured 12 to 13 seats. But Arab parties have never sat in an Israeli coalition before, complicating any potential deal.
Stav Shaffir, a leader of the Zionist Union, called the results a "clear vote of no confidence in Netanyahu."
She said the Zionist Union would wait for the official results before declaring victory or defeat, but claimed Netanyahu's opponents "have a majority."
Netanyahu has ruled out a "unity" government with the Zionist Union that would give him a broad coalition, and Herzog has also been cool to the idea.
That would indicate the next government will be a narrow majority - a recipe for further instability in which any member could bring it down. The previous government lasted less than two years before crumbling apart.