Israeli Prime Minister Benjamin Netanyahu looked set for another term Wednesday as his main rival conceded defeat.

"It is a night of colossal victory," Netanyahu told supporters in a speech late Tuesday.

On Wednesday, Yair Lapid, a leader of the centrist Blue and White Party led by former military chief Benny Gantz, conceded in a televised statement that the party "didn't win in this round."

"We will make Likud's life hell in the opposition," he added, referring to Netanyahu's right-wing party. Both Likud and Blue and White won the same number of seats in the 120-member Parliament.

The results affirmed Israel's tilt to the right and further dimmed hopes of a negotiated solution to the Israeli-Palestinian conflict.

Both Netanyahu and Gantz claimed victory after the exit poll results were released. But as the night went on, there were growing signs that Netanyahu's Likud was pulling ahead.

"The right bloc in the Likud won a definite victory. I thank the citizens of Israel for their trust. I will begin forming a right-wing government with our natural partners tonight," Netanyahu tweeted in Hebrew.

If Netanyahu's Likud Party succeeds in forming a parliamentary majority and he again serves as prime minister, it would be his fourth consecutive and fifth overall term, making him the longest-serving leader in the country's history.

Gantz on Wednesday morning said that although "there is a dark sky," there was still reason for hope.

"The reports tell an unfinished story," he tweeted. "There is nothing final in them since there may be electoral movements and we may be able to develop political moves of one kind or another."

The election has been widely seen as a referendum on the scandal-plagued Netanyahu, who in the waning days of the campaign pledged to annex Jewish settlements in the occupied West Bank if re-elected.

His campaign was severely tested by Gantz, 59, a former head of the Israeli Defense Forces and a political novice who formed the Blue and White Party, a coalition of centrists and former military officers, on a promise of clean government and social harmony.

Gantz, a retired three-star general, sent a jolt through Israeli politics this year when he partnered with centrist politician and former television host Yair Lapid to form the new party. If elected, Gantz would lead the government for two and a half years, with Lapid doing so for the remainder of the four-year term.

Benny Gantz addresses supporters on Wednesday. Sebastian Scheiner / AP

Gantz hit out at Netanyahu over the series of scandals swirling around him. Netanyahu tried to portray Gantz as inexperienced and weak.

Palestinians on Wednesday morning expressed disappointment with the election result.

"Regrettably, Israelis overwhelmingly voted for candidates that are unequivocally committed to entrenching the status quo," PLO executive committee member Hanan Ashrawi said.

Under Israel's political system, building a government is an uncertain and sometimes tortuous process.

No Israeli party has ever won an outright majority in the 120-seat Parliament — which means larger parties must form a coalition with smaller ones.

More than 40 parties competed in the elections, including ultra-Orthodox religious parties, Arab factions and fringe movements such as the Pirate and Simply Love party. Only a handful were expected to win the 3.25 percent of the vote necessary to break the electoral threshold and earn the minimum four seats in Parliament.

Negotiations could take days or even weeks. After final results are released in around 24 hours or so, President Reuven Rivlin will meet with party leaders and select the one he believes is most capable of forming a coalition based on each party’s recommendations.

That party, usually but not always the largest faction, then has four weeks to form a coalition. A new government will be given the four-year term, but disagreements between coalition parties often result in early elections.

Should neither bloc be able to form the coalition, Israel could face the prospect of a second election in November.

Election Day is a national holiday and Israeli elections tend to have high turnout. The last elections in 2015 saw voter turnout of 72 percent. But Arab voters, who make up 20 percent of the electorate, were expected to boycott the vote amid accusations that Netanyahu was inciting the public against them.

Netanyahu has run a series of right-wing governments that have included religious, far-right and marginal parties. But his recent decision to forge an alliance with a fringe extremist party inspired by an American-born rabbi, Meir Kahane, who advocated a Jewish theocracy and the forced removal of Palestinians, raised alarm among even some Netanyahu allies.

The passage in July of the “nation-state” law declaring that only Israel's Jews had the right of self-determination and stripping Arabic of its designation as an official language alongside Hebrew was also decried by critics who say it institutionalized discrimination.

Serious scandal dogged Netanyahu's run. On Feb. 28, Israel's attorney general recommended indicting Netanyahu on bribery, fraud and breach of trust in three different cases. He has also been caught up in a scandal involving the $2 billion purchase of submarines from a German company. Police have recommended that Netanyahu's personal attorney, who is also his cousin, be indicted on charges of bribery and money laundering, although the prime minister himself is not a suspect.

Netanyahu has called the investigations a “witch hunt.”

Likud campaign posters showing Prime Minister Benjamin Netanyahu litter the floor at the party's headquarters in Tel Aviv. Jack Guez / AFP - Getty Images

During the campaign, he highlighted his close relationship with President Donald Trump — an especially popular figure in Israel even when compared to decades of close relations between the countries.

Trump has made a series of decisions that have endeared him to Netanyahu and to many Israeli voters. Washington's withdrawal from the nuclear agreement with Iran — which many Israelis see as an existential threat — was a coup for Netanyahu. Then came the decision to move the U.S. embassy to Jerusalem. And on March 21, Trump recognized Israel's annexation of the Golan Heights, which Israel captured from Syria in 1967.

In addition, Trump's ambassador to Israel, David Friedman, is popular among Israeli right-wing voters. He has written articles against a two-state solution and given money to groups supporting Jewish settlements in the West Bank.

Netanyahu visited the White House on March 25 — underscoring the relationship. And Monday, he issued a personal message to Trump after the administration announced it was designating the Iranian Revolutionary Guard Corps as a foreign terrorist organization.

"Thank you, my dear friend," he said. "Thank you for responding to another important request of mine, which serves the interests of our countries and countries of the region."