Tel Aviv’s mayor on Thursday blamed Israel’s occupation of the Palestinian territories for a deadly attack carried out by two Palestinian gunmen that left four Israelis dead in the Mediterranean city.

Labour Mayor Ron Huldai, 71, told Israeli army radio that the occupation was to blame for Wednesday evening’s attack when two armed Palestinian men from near Hebron in the southern West Bank walked into a popular cafe and opened fire on revellers.

"We might be the only country in the world where another nation is under occupation without civil rights,” he said. “You can’t hold people in a situation of occupation and hope they’ll reach the conclusion everything is alright."

Huldai added "no one has the courage" to find peace with the Palestinians, and he called for attempts to strike an agreement when there is a lull in attacks.

"There has been an occupation for 49 years, which I was part of and I know the reality, and I know leaders need courage to not just talk.

"We have to show our neighbours that we have true intentions to return to a reality of a smaller Jewish state with a clear Jewish majority."

Deputy Defence Minister Eli Ben-Dahan responded to Huldai by calling his comments "bizarre" and "delusional".

"I heard the mayor of Tel Aviv saying the ‘occupation’ is to blame, or that it’s because we don’t have a peace treaty with the Palestinians, and that’s why we have terrorism," Ben-Dahan told an audience at the Institute of National Security Studies.

"I want to remind him that there was terrorism here 100 years ago, and in 1929 Jews were murdered [in a massacre in Hebron] and there was no State of Israel. There wasn’t even an ‘occupation.’"

The cafe in Sarone Market in Tel Aviv remained open on Thursday afternoon, while an extra two battalions comprising hundreds of troops were poured into the West Bank as the attackers’ home town of Yatta was put on lockdown.

Army vehicles marshalled entry points to the village near Hebron, with soldiers stopping and searching all those leaving and entering.

The two attackers were identified as Mohammad Makhamrah, 22, and his cousin Mohammad Ahmad Makhamrah.

The four people killed were all Israelis and were identified as Ido Ben Aryeh, 42, Ilana Nave, 39, Michael Feige, 58, and Mila Mishayev, 32.

The two Palestinian attackers are both in custody, and one of them has undergone surgery after being shot by police.

Israeli parliament member Bezalel Smotrich tweeted on Thursday that he was "concerned" police hadn’t shot dead the two attackers at the scene, rather than arresting them.

"A terrorist who goes to harm Jews should not come back alive, period," he wrote.

Throughout the day on Thursday Israeli politicians flocked to the Sarona market, including Defence Minister Avigdor Liberman, Education Minister Bennet and leader of the opposition Yitzchak Herzog.

Before Israel’s security cabinet was due to meet and discuss a response to the attack Liberman released a statement that said: “Life in the Yatta village won’t carry on as usual. A village that has terrorists leaving its midst will pay the price.”

A spokesperson for the Gaza-based Hamas movement praised the attack, saying it was a "heroic operation".

Meanwhile the head of the Israeli-Palestinian Joint List Aymen said the incident was a "terrible blow to civilians".

"My heart goes out to the families. An attack against innocent people is always reprehensible, there can be no justification for shooting civilians in the street," he said.

Odeh added that the current far-right coalition Israeli government has contributed to a "deepening of hatred and violence".

Other members of Odeh's Joint List joined in the condemnations of the attack but they too attacked the Israeli government's "immoral collective punishment against the Palestinians" in response.

"We reject attacks on civilians in every way. Such an act does not advance Palestinian rights," Ahmed Tibi and Osama Saadi said in a joint statement.

One of Israel's first responses to the attack was to revoke tens of thousands of Palestinian entry permits. COGAT, the defence ministry unit which manages civilian affairs in the West Bank, said that 83,000 Palestinians would be affected. The measures included freezing permits for 204 relatives of one of the alleged attackers.

The two Joint List parliamentarians said "collective punishment" of Palestinians for the Tel Aviv attackers would not solve the problem, adding: "Only ending the occupation will bring peace."

Musa Muhamara, mayor of Yatta, said the two attackers were not members of any known militant groups according to Israeli daily Haaretz.

"We're very surprised, and the only explanation for what happened is that the two were influenced by all that has happened recently," he said, referring to the wave of attacks since October. "It must be mentioned that the Hebron area, including Yatta, has paid a heavy price in terms of those killed and of incidents, and this apparently influenced them."

Violence since October has killed at least 207 Palestinians, 32 Israelis, two Americans, an Eritrean and a Sudanese.

Most of the Palestinians killed were carrying out knife, gun or car-ramming attacks, according to Israeli authorities.

Others were killed in clashes with security forces or by Israeli air strikes in the Gaza Strip.