JERUSALEM (AP) -- Israelis were voting in parliament elections Tuesday, after a heated three-month campaign that focused on economic issues but ended with a dramatic last-minute pledge by Prime Minister Benjamin Netanyahu to prevent the establishment of a Palestinian state.
Netanyahu's comments marked a reversal of long-standing promises to the United States and were seen as a last-ditch effort to appeal to hard-line voters as he fights for his political survival in a close race.
He claimed that any state established alongside Israel would be controlled by Islamic extremists who "will attack us with rockets."
"Who wants such a thing?" Netanyahu said in a phone interview with Israel TV's Channel 10 after casting his ballot early on Tuesday.
Netanyahu appeared to be appealing to his hard-line base with these comments, after polls indicated his Likud Party is trailing slightly behind the Zionist Union of centrist challenger Isaac Herzog.
Herzog has said he would revive peace efforts with the Palestinians, repair ties with the U.S. and reduce the growing gaps between rich and poor.
"Whoever wants to follow Bibi's (Netanyahu's) path of despair and disappointment will vote for him," Herzog said after casting his vote. "But whoever wants change, hope, and really a better future for Israel, will vote the Zionist Camp lead by me."
Israelis vote for a 120-member parliament, casting ballots for a party list, rather than individual candidates. After an election, it typically takes weeks of negotiation to form a governing coalition and determine who will be prime minister.
Several smaller centrist and religious parties that have not pledged support for either Netanyahu or Herzog will play an oversized role in such negotiations.
Netanyahu has governed for the past six years and has long been the most dominant personality in Israeli politics.
He has swung further to the right in the final stages of the campaign, appealing to his base.
In his interview with Channel 10, he ruled out a coalition with Herzog and said he would seek an alliance with the ultra-national Jewish Home party, which also opposes Palestinian statehood.
Netanyahu portrayed Herzog as someone who would easily give up territory for a Palestinian state. The Palestinians want to establish a state in the West Bank, Gaza Strip and east Jerusalem, lands Israel captured in the 1967 Mideast war.
"We have a different approach," Netanyahu said. "They (the Zionist Union) want to withdraw. I don't want to withdraw. If I put together the government, it will be a nationalist government."
Netanyahu's comments marked a political gamble.
For years, he assured the international community that he accepts the idea of Palestinian statehood and that he is ready to negotiate the terms of such a state. Netanyahu has portrayed Palestinian President Mahmoud Abbas as the main obstacle to a peace deal.
If Netanyahu were to be re-elected, it would be more difficult for him to argue that Israel is a partner in U.S.-led peace efforts. Washington views the establishment of a Palestinian state as a pillar of its Mideast policy.
Herzog, meanwhile, signaled he is going back on what had been perceived as an unpopular power-sharing deal with the co-leader of the Zionist Union, former Foreign Minister Tzipi Livni.
Under that deal, Herzog and Livni would each have served as prime minister for two years if they won the elections.
More on AOL.com:
President: Cyclone devastation forcing Vanuatu to start anew
French police on trial for teen deaths that kicked off riots
Cold returns to the Midwest for St. Patrick's Day, East later this week