TEL AVIV, Israel -- Israeli liberals woke up after national elections with a demoralizing feeling: Most of the country, in a deep and possibly irreversible way, does not think like they do.

There had been a sense of urgency among moderate Israelis, and even an ounce of hope, that widespread frustration with Prime Minister Benjamin Netanyahu's six straight years in office would lead voters to pull Israel away from what they perceive as its rightward march toward international isolation, economic inequality and a dead end for peace with the Palestinians.

But as the results trickled in on Wednesday, they showed Likud with a shocking lead that has all but guaranteed Netanyahu a third consecutive term. Netanyahu called it a victory "against all odds." The liberals' optimism has been replaced with despair -- and an infuriating belief that the masses may never understand that logic shows the current path is suicidal.

"Drink cyanide, bloody Neanderthals. You won," award-winning Israeli author and actress Alona Kimhi wrote on her Facebook page, before erasing it as her comments became the talk of the town. "Only death will save you from yourselves."

Such rage rippled through liberal Israel this week. Social media was full of embittered Israelis accusing Netanyahu's supporters of racism, and some vowed to stop donating charity to the underprivileged whom they perceived as being automatic supporters of the right.

The prime minister's main rival denounced such attacks. "Attempts to divide, vilify and spread hate in Israeli society disgust me, and it doesn't matter whether it comes from the right or the left," wrote Zionist Union leader Isaac Herzog on Facebook.

The anger was about far more than the election, reflecting a larger and more dramatic battle for the heart of the country.

Israel's founding fathers were Jews of Ashkenazi, or eastern European, descent and the ideological predecessors of the Labor party, the main faction in the rebranded Zionist Union. The left led the country for its first three decades until Likud -- heavily backed by working class Jews of Mizrahi, or Middle Eastern, descent -- gained power in 1977.

The Labor Party returned to power in the 1990s, leading the first efforts at peace with the Palestinians. But the Palestinian uprising in the early 2000s saw the return of hawkish rule, which in one form or another has lasted until today.

The divisions between right and left largely revolve around the question of what do with territories captured by Israel in the 1967 Mideast war -- and the millions of Palestinians who live there.

Parties on the left would trade the land for peace and allow the creation of a Palestinian state. They also argue that the lands are a liability, since incorporating the Palestinians as citizens would destroy Israel as a Jewish-majority state.

The right emphasizes the lands' strategic value and biblical symbolism and pushes constantly for settling them with Jews. Its success in this endeavour has, paradoxically, put the country on a path toward being a place where Jews may no longer be a strong majority.

With more than 550,000 Israeli settlers now living in territories claimed by the Palestinians, Israeli liberals -- along with the Palestinians -- believe time is running out for the "two-state solution." So compelling is this "demographic argument" that Netanyahu himself has adopted its language, claiming at various times since 2009 that he, too, wants to end the occupation; but his party opposes this and Netanyahu continues to support the settlements, leading opponents to believe he is bamboozling them and adding to the sense of urgency.

Activists at the headquarters of V-15, an initiative that called to unseat Netanyahu, silently bundled dozens of banners on Thursday, and one activist asked a journalist to leave. A whole floor of the Zionist Union's campaign headquarters was empty, and party leaders gazed up from crumpled posters next to a vacuum cleaner.

"It's a big disappointment. There was a lot of energy for change here," said Zev Laderman, an investor in start-up companies, sitting in a boulevard cafe. "I woke up this morning to realize that I'm a minority in this country."

The centre-left's Zionist Union won 24 seats -- somewhat higher than the combined previous total of the two parties that form it -- but Likud won 30. Another 37 seats were captured by parties believed to be willing to support Likud for a solid majority in the 120-member parliament. And the left-wing Meretz party will now be the smallest party in the upcoming government.

The looming coalition likely will feature right-wing pro-settler and ultra-Orthodox Jewish religious parties. In fundamental ways, they represent the opposite of the defiantly secular Israeli liberals who are fed up with taxpayer money being pumped to West Bank Jewish settlements and ultra-Orthodox Jewish communities.

The prime minister's sudden turnaround toward victory took place after an 11th-hour effort to appeal to nationalist Israelis by pledging not to support an independent Palestinian state, and by warning voters of Arab citizens being bused to the polls in "droves" by left-wing organizations -- comments that drew rebukes from Israeli Arabs and the White House.

Netanyahu since has tried to contain the damage from his statements -- saying he remains committed to Palestinian statehood if conditions throughout the region improve -- and insisting he is not a racist. But it seems unlikely that peace negotiations with the Palestinians will be high on his agenda. And the Jewish settlement of the West Bank, which enrages liberal Israelis and cements the country's entanglement there, likely will march on.

Liberal voters perceived this week's defeat less as the result of a poorly fought campaign than as a reflection of demographic trends and genuine public opinion in the country of 8 million.

After years of failed peace efforts, including two Israeli offers for statehood that were rejected or ignored by the Palestinians, few think a deal is likely. Even the Zionist Union seemed to hide from the issue during the campaign, focusing instead on bread-and-butter issues like the country's high cost of living.

"It doesn't matter what kind of campaign (the left) ran," political blogger Tal Schneider said. "There is a reality in the field. You can't change it. It's a nationalist public that is afraid of the Arabs."

Sitting at a bustling cafe in a hipster neighbourhood of Tel Aviv, a 26-year-old campaign activist for the Zionist Union broke down in tears about the party's defeat.

"It's devastating," activist Lior Shalish said. She said the election results shouldn't be a surprise, just months after left-wing Israelis were attacked on the streets of Tel Aviv by nationalists during Israel's war against Hamas militants.

"You don't get a left-wing government after that. Like, that doesn't change so quickly," Shalish said. "We were stupid to believe that it does."

Some liberal Israelis said there were rays of light: A joint list unifying various Arab parties emerged as the country's third-largest party, re-energizing a disaffected Israeli Arab minority, and the V-15 initiative claims it increased turnout by centrist and left-wing voters.

In the lead up to the election, the left's momentum reached its peak at a major rally this month, when tens of thousands of Israelis packed a Tel Aviv square demanding a change of government.

The rally was seen as a victory. Many focused on the keynote speech by Meir Dagan, a former head of the Mossad intelligence agency, who issued an emotional appeal for change.

But in retrospect, it seems a tipping point in favour of Netanyahu occurred when artist Yair Garbuz took to the podium and railed against the "amulet kissers" who support Netanyahu.

His comments were perceived as a condescending swipe at the country's conservative working class of religious Jews of Sephardi, or Middle Eastern, lineage who have longstanding gripes with the country's European-descended Ashkenazi elite and lean heavily toward Likud.

The day after elections, columnist Ben Caspit wrote an article in the Maariv daily newspaper titled "Two States." He was not referring to the left's two-state solution for the Israeli-Palestinian conflict, but to Israel's own cultural divide.

"Israel is split -- between left and right, between Bibi and anti-Bibi, between aspirations for normalcy and aspirations for territory," Caspit wrote, using Netanyahu's nickname. "Two states, two styles, two world views, split once again."