JERUSALEM (Reuters) - Israeli Prime Minister Benjamin Netanyahu on Thursday threatened war in Gaza and then flew to Russia to discuss Israeli freedom of action in Syria with President Vladimir Putin as a frenetic election race neared its end.

Slideshow ( 3 images )

Before Netanyahu embarked on a visit to the Black Sea resort Sochi to see Putin, Russia condemned Netanyahu’s announced plan to annex the Jordan Valley in the occupied West Bank, after next Tuesday’s election in Israel.

In an interview with Israel’s Kan public radio, Netanyahu was questioned about persistent rocket attacks by Palestinian militants in Gaza. His opponents in what opinion polls show to be a close race have accused him of failing to do enough to end the strikes on southern Israel.

“We will probably be forced - there’ll be no choice - to enter into a campaign, a war, in Gaza,” Netanyahu said.

He said, however, that he does not risk soldiers’ and civilians’ lives “just to get applause”, and he was vague about when any such offensive war might start.

Netanyahu made the remarks two days after sirens warning of rocket fire from Hamas Islamist-run Gaza forced him off the stage at a campaign rally in southern Israel.

Israel has responded to such attacks by launching air strikes against facilities belonging to Hamas, the dominant armed group that controls the Gaza Strip.

With opinion surveys showing his right-wing Likud neck and neck with the centrist Blue and White party, Netanyahu’s Russia visit could help him burnish a statesman’s image that he has promoted throughout the campaign.

Netanyahu’s election posters have featured him shaking hands with Putin and U.S. President Donald Trump, a close ally.

“I think Israeli citizens know that if it weren’t for my connections, and meetings every three months (with Putin), we would have clashed a lot,” Netanyahu, referring to the Russian military in Syria and Israeli forces that have been attacking Iranian-linked targets there.

“The Russian army and the Israeli military and our air force are within touching distance...the big issue is how to succeed in maintaining our freedom of action in such a crowded area,” he said on the radio.