Israeli Prime Minister Benjamin Netanyahu appears to be on his way to a fourth consecutive term.

The election is neck-and-neck between his right-wing party and that of his top contender, centrist political newcomer Benny Gantz. But with at least 97 percent of the votes counted, Netanyahu appears to be in the best position to form a government because of the strength of other right-wing, nationalist and religious parties.

In the final days of the campaign, Netanyahu has vowed to annex Jewish settlements in the occupied West Bank – a move that would quash any remaining hopes of a two-state solution to the Israeli-Palestinian conflict.

Israeli voters were choosing between some 40 different candidate lists, representing parties, alliances and individuals. Netanyahu's Likud party and Gantz's Blue and White alliance each appear to have secured 35 seats.

Netanyahu and his main rival, a former military chief of staff, both declared victory shortly after the polls closed. But according to Haaretz, parties in the right-wing block total are poised to take 65 seats, eclipsing the 55 seats from the center-left bloc that would likely align with Gantz.

On Wednesday, Gantz wrote this message to his supporters, according to The Associated Press: "Though the skies appear gloomy, nothing is final. There could be changes and some political options could open up. ... Our voters asked for hope and we gave it to them. They wanted a different way and we outlined it."

Israel's president, Reuven Rivlin, is charged with declaring which candidate will have the first opportunity to try to put together a government. He's set to meet with party leaders for their nominations, and he's announced that those meetings will be broadcast live to "ensure transparency for Israel's citizens."

Copyright 2019 NPR. To see more, visit https://www.npr.org.