By Luke Baker and Jeffrey Heller

JERUSALEM (Reuters) - Israeli Prime Minster Benjamin Netanyahu pledged on Wednesday to form a new governing coalition quickly after an upset election victory that was built on a shift to the right and drew an immediate rebuke from the White House.

In the final days of campaigning, Netanyahu abandoned a commitment to negotiate a Palestinian state - the basis of more than two decades of Middle East peacemaking - and promised to go on building settlements on occupied land. Such policies defy the core vision of a solution to the Israeli-Palestinian conflict embraced by President Barack Obama and his Republican and Democratic predecessors.

With nearly all votes counted, Netanyahu's Likud had won 29 or 30 seats in the 120-member Knesset, comfortably defeating the center-left Zionist Union opposition on 24 seats. A united list of Israeli Arab parties came third.

The result was a dramatic and unexpected victory for Netanyahu - the last opinion polls four days before the vote had shown Likud trailing the Zionist Union by four seats.

Although Netanyahu must still put together a coalition, his victory all but guarantees that Israel's president will give him the first opportunity to form a government, putting him course to become the longest-serving leader in the country's history.

"I am moved by the responsibility Israel has given me and I appreciate the decision by Israel's citizens to elect me and my friends, against all odds and in the face of powerful forces," Netanyahu said during a traditional thanksgiving visit to Judaism's holy Western Wall in Jerusalem.

But the promises he made to ultranationalist voters in the final days of the campaign could have wide consequences, including deepening rifts with the United States and Europe and potentially emboldening Palestinians to take unilateral steps toward statehood in the absence of any prospect of talks.

The White House scolded Netanyahu for abandoning his commitment to negotiate for a Palestinian state and for what it called "divisive" campaign rhetoric toward Israel’s minority Arab voters.

Story continues

Washington signaled that its deep disagreements with Netanyahu will persist on issues ranging from Middle East peacemaking to Iran nuclear diplomacy.

Saeb Erekat, chief Palestinian negotiator in peace talks that collapsed last year, lamented "the success of a campaign based on settlements, racism, apartheid and the denial of the fundamental rights of the Palestinian people".

Likud said Netanyahu intended to form a new government within weeks, with negotiations already under way with the far-right pro-settler Jewish Home party led by Naftali Bennett, the centrist Kulanu party and ultra-Orthodox groups.

The critical party to get on side will be Kulanu, led by former Likud member and communications minister Moshe Kahlon, who won 10 seats, making him a kingmaker given his ability to side with either Netanyahu or the center-left opposition.

"The citizens of Israel expect us to quickly put together a leadership that will work for them regarding security, economy and society as we committed to do - and we will do so," Netanyahu said.

Netanyahu's deputies were already holding preliminary talks with potential coalition partners, Israeli media said.

President Reuven Rivlin said he would launch consultations with party leaders on Sunday to try and form a new government as soon as possible.

Isaac Herzog, leader of the Zionist Union, conceded defeat and congratulated Netanyahu. Herzog said he would not seek to join a Netanyahu-led government.

The Tel Aviv stock market was largely unmoved by Netanyahu's victory, with the benchmark Tel Aviv 100 index up marginally at mid-day.

"The market's indifference to the results apparently stems from its belief that the coalition that will be formed will be more stable than its predecessor," said Idan Azoulay, chief investment officer at the Epsilon brokerage.

HARD ROAD AHEAD

While Likud is the largest party, the process of forming a coalition could be challenging, with potential political partners certain to raise a variety of demands.

With the backing of right-wing and religious factions, and with Kahlon also on board, Netanyahu could end up with 67 parliamentary seats, a commanding majority.

If Netanyahu follows through on his pledges it would put him on a collision course with the Obama administration and the European Union, which has been weighing steps including trade measures to sanction Israel for its settlements policy.

The White House was already angry with him for addressing the U.S. Congress at the invitation of Republican lawmakers in a bid to scupper U.S. nuclear talks with Iran.

Obama was not quick to congratulate Netanyahu on his victory, and the White House said such a call would be made in the coming days.

But White House spokesman Josh Earnest was critical of some of Netanyahu's comments in the final days of his campaign.

Earnest told reporters the administration would evaluate its approach on the Middle East peace process following Netanyahu's statement that there would be no Palestinian state on his watch.

During much of the campaign, Netanyahu had focused on security issues and the threat from Iran's nuclear program, a message that appeared to gain little traction with voters.

The Zionist Union emphasized socio-economic issues, including the high cost of living in Israel, and its message had seemed to be generating much more momentum.

But Netanyahu's move to the right, playing up fears of the spread of Islamist groups, promising no concessions to the Palestinians and raising alarm about growing support for Arab-Israeli parties, looks to have spurred his base into action.

For the Palestinians, the results are a deep concern, raising the prospect of more settlement expansion on land they want for their own state in the occupied West Bank and East Jerusalem, as well as in Gaza.

Netanyahu's victory also raises questions about what happens on Iran, with Obama determined to pursue negotiations toward an agreement on Tehran's nuclear program and the Israeli leader determined to foil what he has termed a "very bad deal".

The Palestinians may quickly create problems for Netanyahu as they join the International Criminal Court on April 1 and intend to pursue war crimes charges against Israel over its occupation of the West Bank and last year's war in Gaza.

(Additional reporting by Steve Scheer and Ari Rabinovitch; Editing by Peter Graff and Giles Elgood)