Israel’s closely fought general election campaign is entering its final stretch with Benjamin Netanyahu’s hopes of re-election hanging in the balance.

Polls show that the prime minister and his centrist challenger, Benny Gantz, are locked in a tight race as voters prepare to render their verdict in less than two week’s time.

All this takes place against a backdrop of renewed rocket attacks from Gaza and retaliatory air strikes against Hamas by Israeli forces (see story below).

The stakes in the election could hardly be higher. Netanyahu is bidding for a fourth consecutive term in office, one which could see him surpass Israel’s founding father, David Ben Gurion, as the Jewish state’s longest-serving prime minister.

Netanyahu also knows that victory could strengthen his hand with the threat of indictment on corruption charges hanging over him.

The prime minister’s opponents believe that defeating him is essential in order to punish his frequent attacks on the police, judiciary and media, and a campaign which, they claim, has attempted to stoke anti-Arab sentiment.

For Gantz, the election campaign has been a roller-coaster ride. The former IDF general’s Israel Resilience party surged to second place in the polls shortly after its formation three months ago when Netanyahu fired the starting gun on the election campaign. When Gantz teamed up with fellow centrist Yair Lapid, leader of the Yesh Atid party, to form the Blue and White alliance last month, he began to overhaul Netanyahu’s once seeming unassailable poll lead. Gantz was also joined by two fellow former IDF chiefs, Moshe Ya’alon and Gabi Ashkenazi. Together, the men offered the most potent challenge to Netanyahu’s “Mr Security” credentials – which have been key to his string of election victories – since the prime minister came to office a decade ago.

In recent weeks, however, Gantz’s effort to unseat Netanyahu appeared to falter before making an apparent recovery in recent days.

The see-sawing polls reflect an increasingly acrimonious campaign in which Gantz and Netanyahu have traded heavy blows.

Gantz’s attempt to wrestle the security mantle from Netanyahu was weakened when it was alleged that the  former IDF chief’s phone had been hacked by Iran. Amid claims that Tehran had acquired embarrassing images of Gantz (a claim he has strenuously denied), the prime minister taunted: “If Gantz can’t protect his phone, how will he protect the country?” “Benny Gantz, what do the Iranians know about you that you’re hiding from us,” Netanyahu later asked. “What are the Iranians holding over you?” Such tactics are designed to dent Gantz’s key political attribute: the perception that, as he himself put it in an early campaign speech, “I have always kept my hands clean.”

But the scandal-ridden Netanyahu also came under heavy fire from Blue and White’s leaders over claims that he profited from the so-called “submarines affair”. Late last year, police recommended a series of indictments in so-called “Case 3000”, an investigation into alleged multi-million pound bribes in the purchase of naval vessels, which involves close members of the prime minister’s circle. Netanyahu has always denied any personal wrongdoing in one of the biggest corruption cases in Israeli history.

As Anshel Pfeffer suggested in Haaretz last week, Gantz’s campaign for the premiership has been hampered by a number of factors.

First, the “minimalist” political strategy developed by his advisers – tightly controlling media access to Gantz and limiting his public appearances – may have worked initially but has proved flawed in the face of relentless attacks from Netanyahu and his Likud party. A series of TV interviews given by Gantz last week suggests a change of tack.

Second, some fear that Gantz lacks the killer instinct to reach the top of Israeli politics. Seen as amiable, modest and laid-back, he lacks Netanyahu’s acute political antennae and has also made a number of gaffes.

Third, while an alliance with Lapid may make political sense in terms of ensuring the centrist vote is not split, the pair’s agreement to rotate the premiership has potentially weakened Gantz’s appeal. As Pfeffer notes, then Labor leader Isaac Herzog made a similar pact with Tzipi Livni when they formed the Zionist Union on the eve of the 2015 general election. As the election drew closer, the plan was abandoned amidst its apparent unpopularity. Lapid and Gantz, however, appear to have repeated the same gambit, while hoping – without much evidence – that it will prove more appealing to voters on this occasion. The fact that – unlike Gantz – Lapid’s popularity rests primarily with urban, middle-class secular voters may also be weakening the ticket.

Nonetheless, after surveys showed Likud retaking the lead, Blue and White now appears to be back in pole position, while Netanyahu also trails Gantz when voters are asked to choose who they would rather see as prime minister. Such a result would not, of course, automatically mean the end for Netanyahu’s premiership. Polls also show that he remains narrowly ahead in the race to assemble a coalition which can command a majority in the Knesset.

There are also signs that, after faring poorly in early surveys, Labor now seems to be recovering. Recent polls show it winning 10 seats, a big drop from the 18 it secured in 2015 (which were buttressed by another six from its then ally Livni) but an improvement on the mere six with which some surveys had indicated it would emerge.

Three highly unpredictable factors may determine the election’s eventual outcome.

First, both Gantz and Netanyahu face the prospect that a number of parties they might rely on to form a coalition may not make it into the Knesset. According to BICOM, in recent weeks, several parties – including Gesher (centrist), Balad/Raam (Arab), Zehut (libertarian/right), Kulanu (centre-right) Yisrael Beitenu (right) – have polled on either side of the 3.25 percent electoral threshold which they must clear to win seats in the Knesset. Other parties such as Shas (ultra-Orthodox) and Meretz (left) are also teetering close to it. A difference of as little as one percent in polling estimates – a party receiving three per cent rather than four percent – could make a significant difference to final tallies and coalition permutations. The polls also typically have a 3-4 percent margin of error.

Second, there are some indications that Netanyahu’s effort to reprise his infamous 2015 election tactic of boosting turnout among right-leaning apathetic Israelis by warning of the political threat posed by Arab Israelis voters may be backfiring. A poll conducted by the University of Maryland shows Arab turnout rising to 69 percent (from 64 percent in 2015). Moreover, certain Arab groups, such as Druze voters, who once offered some measure of support to right-wing parties now appear to be fleeing Netanyahu. More than half Druze voters now back Gantz, and support for the right has dropped from 40 to less than 20 percent among Druze voters.

Finally, Monday morning’s rocket attack from Gaza on central Israel – which saw seven people, including two children, injured – underlines the precarious security situation in Gaza which may impact upon the election. As he did at the end of last year when Hamas launched a barrage of rockets into Israel, Netanyahu is facing pressure from the right to order a tough response. Education minister Naftali Bennett of the New Right party said any Israeli ceasefire would be an “embarrassment for Israel” and  “give a bizarre backing to terror.”

From the left and centre, too, Netanyahu has also come under attack. Lapid called for the IDF “to restore deterrence and send a clear message to Hamas – no attacks on Israeli citizens anywhere in the country”.

The leader of the left-wing Meretz party, Tamar Zandberg, called upon the government to “reach a stable ceasefire and to immediately seek a broad agreement that will include the rehabilitation of the Gaza Strip, the lifting of the blockade and the opening of negotiations for a political settlement”.

But Netanyahu, whose electoral appeal rests heavily on the sense that he has brought calm and stability and knows how to keep Israelis safe, will be desperate to avoid a major escalation, the consequences of which may be difficult to control. “If missiles are not launched at central Israel, it is reasonable to assume that Netanyahu will try to put on the brakes soon, after he decides that Israeli public opinion has been satisfied,” suggested one commentator.

Four years ago, Israel’s general election appeared to be similarly heading to a photo finish. In the end, however, Netanyahu managed to secure a comfortable Likud edge over Labor and then eke out a narrow coalition. He will be hoping to repeat that feat in two week’s time, but the heavier legal baggage under which he is heading to the finish line may just produce a different outcome.