"Out of the taxi!" barked the driver. "Air raid!"

The car stopped dead at the junction of Yitzhak Sadeh and Yigal Alon Streets as we clambered out and over to a cluster of trees.

The scouring jet-engine sound of rockets carved through the sky. Air raid sirens echoed across Tel Aviv.

Drivers abandoned their vehicles and joined pedestrians scampering to lying positions under the eucalyptus trees.

A father covered his young son and daughter on the dirt, whispering reassuring words.

The rockets and sirens passed.

Later the Al Quds Brigade, the military wing of Islamic Jihad, claimed responsibility for the rockets that had sailed in from Gaza; one Israeli civilian was injured in the centre of Tel Aviv.

It was an unsettling episode, but nothing compared to the death and destruction that rain down on Gaza every day and night.

Israel is now routinely accused of committing genocide or at the very least war crimes.

The aftermath of the Hamas attack at a music festival in Israel
The aftermath of the Hamas attack at a music festival in Israel on 7 October

UN Secretary General Antonio Guterres says there is "something clearly wrong in the way that [Israeli] military operations are being done".

Even Israel's staunchest ally US President Joe Biden said Israel had "an obligation to distinguish between terrorists and civilians and fully comply with international law".

In Israel, there is an entirely different attitude.

The atmosphere following the 7 October massacres has been likened, accurately, to the United States after 9/11.

Israeli flags hang from buildings and flutter from cars; 24-hour news channels stream a non-stop diet of frontline military reports, peppered with death tolls of "terrorists"; there are patriotic exhibitions for the hostages, candles, music, memorials.

Locals, when they see the RTÉ camera, beseech us to "tell the truth" to the world about what Hamas had done.

"Have you read Hamas’s founding charter?" one man asked me, disbelievingly.

"They want to wipe us off the earth. Is that not a war crime?"

Israelis are not just emotionally raw: there is a blanket consensus that the Israeli Defense Forces (IDF) must eliminate Hamas because Israel's very survival is at stake.

Yet, official rhetoric which sounds like giving the IDF a blank cheque to commit genocide has abounded.

Benjamin Netanyahu quoted Deuteronomy, saying "You must remember what Amalek did to you," a none-too-subtle reference to a rival nation which God commanded King Saul to destroy by killing every last person.

Defence Minister Yoav Gallant said Israel was fighting "human animals" in Gaza.

President Isaac Herzog blamed "an entire nation" for the 7 October attacks.

"They could have risen up. They could have fought against that evil regime which took over Gaza in a coup d’etat."

But even among thoughtful, liberal Israelis who sympathise with the Palestinian population, there is the unanimous belief that this is a just war and the IDF are conducting it according to international law.

"I'm a mother of three, and I have a six-month-old baby," one Tel Aviv resident told me.

"I have a very hard time watching the news. My heart does break for every Palestinian mother who is now terrified for her children.

"And we're not in the same situation. We have shelters here. And although I am terrified for my children, of course, they're in a dire situation there. But this is not an act of revenge."

Professor Asa Kasher, the man we were going to visit when we had to dive for cover, is a philosopher who co-wrote the IDF’s first Code of Conduct in the early 1990s.

"Non-combatants shouldn’t suffer," he says. "We keep this regulation very carefully. We will never just drop a bomb like during the Second World War, [when an airforce would] take a city, a place full of civilians, with no military base, and just bomb it in order to terrify the people and push them into surrender."

This is not a claim that sits well with the daily images of pancaked buildings - whole neighbourhoods destroyed - and crushed bodies piling higher each day in Gaza.

However, in the cold light of international law, Israel insists it is entitled to prosecute a much deeper and broader war against Hamas than previously.

Even liberal law professors say the 7 October attacks catastrophically altered Israel’s strategic vulnerability, and that a war of self-defence, however horrific, is legal.

"In nearly every other human situation death and destruction are morally wrong and most likely a crime," says Ziv Bohrer, a senior lecturer at Bar-Ilan University Faculty of Law and researcher at the Begin-Sadat Centre for Strategic Studies.

"Therefore, when people look at images from war they intuitively assume that something wrong has happened, and we very quickly, in the modern age, translate morality to war, so it’s got to be a war crime."

Bohrer adds: "War is one of these horrible exceptions in which a lot of civilian deaths are actually legal."

Are Israel’s actions legal?

The starting point is the Law of Armed Conflict (LOAC). It applies to wars between countries, and to wars between countries and what are termed non-state actors (like Hamas).

These rules flow from the 1949 Geneva Conventions to which both Israel and Palestine acceded (the rules also apply to Hamas as it administers Gaza), as well as the Hague Regulations and protocols added over time.

There are two key principles: jus ad bellum and jus in bello.

The first covers the conditions under which a country decides to go to war, the second how the state prosecutes that war.

Israel uses the jus ad bellum principle to argue it is acting in self-defence.

Strictly speaking, the rights and wrongs of Israel’s occupation of Palestinian lands, the economic blockade of Gaza, the expansion of settlements in the West Bank, are not relevant to legal definitions of Israel’s right to go to war following 7 October.

It’s the second principle - jus in bello - which is at the heart of the debate raging over Israel’s actions in Gaza.

A fundamental rule of jus in bello is to distinguish between soldiers and civilians, and between military objectives and civilian objects (schools, hospitals, homes that do not have a military use).

In 1977, the Geneva Conventions were updated by Additional Protocol I, which bans wanton destruction and unnecessary suffering and adds further protections for women, children and other non-combatants.

Israel is not party to the protocol, but under what is known as "customary law" it observes the limitations and in theory accepts they are binding.

By far the most controversial principle in the current war is that of proportionality.

Put bluntly, it is not against the laws of war to kill civilians in the pursuit of a military advantage, but the deaths of civilians must be "proportionate".

If an army is seeking to capture a military objective and civilians get killed in the process, then the deaths should not be excessive, relative to the military advantage gained.

There are heavy qualifications - militaries cannot use indiscriminate force, or weapons whose destructive force are unlimited.

Amnesty International further argues: "Using [military advantage] to justify attacks aimed at harming the economy of a state or demoralising the civilian population in order to weaken the ability to fight would distort the legal meaning of military advantage, undermine fundamental principles of international humanitarian law, and pose a severe threat to civilians."

Where Israel feels that threat most acutely is through rocket attacks on civilian population centres

If Israel is at war with Hamas, and Hamas has embedded itself throughout the civilian population (in the most densely populated urban area in the world), then are the 10,000 deaths proportionate to Israel’s military objectives in destroying Hamas?

The broad view in Israel, certainly among academics, is that context is everything, and that the context in 2023 is different to all the other wars that Israel and Hamas have fought (for example, in 2009 and 2014).

In the 30 odd years that Israel and Hamas have been in conflict deep patterns have formed.

Israel enjoys overwhelming military power and a formidable array of hi-tech and human intelligence over a small area.

In response to this asymmetric situation, Hamas has built a network of tunnels and a vast supply of rockets positioned, according to numerous reports, in civilian locations in order to leverage its threat against Israel.

Where Israel feels that threat most acutely is through rocket attacks on civilian population centres (Hezbollah in Lebanon can hit all of Israel’s cities), and through the kidnapping of Israeli soldiers.

Universal conscription in Israel means there is an extremely high aversion to soldiers being abducted and the IDF goes to enormous lengths to get soldiers freed (in 2011 Israel released 1,027 Palestinian prisoners in exchange for one soldier, Gilat Shalid, held hostage for five years).

A fighter from Izz al-Din al-Qassam stands in front of a tunnel during an exhibition of weapons, missiles and heavy equipment for the military wing of Hamas in the Maghazi camp in central Gaza

Hamas is accused of using its tunnels to attack or kidnap Israeli soldiers, then to draw the IDF into air strikes on Gaza that cause civilian casualties and destroy infrastructure, which in turn intensifies international pressure on Israel and increases its isolation.

The Gaza War of 2014 was triggered by the kidnapping and murder of three Israeli teenagers in the West Bank (Israel’s response was heightened by the discovery in March of that year of a Hamas tunnel running under the border towards a Kibbutz).

However horrific the outcome of the 2014 war (2,251 Palestinians killed, including 1,462 civilians), Israel’s bombardment of Gaza was not nearly as overwhelming as the current war.

The reason, according to several observers, is that Israel believed Hamas’s administrative power in Gaza - and the reminder that Israel had the option to go further next time - would constrain it from further attacks.

This is the fork in the road theory: Hamas could normalise as a government, but run the risk of losing legitimacy in the eyes of ordinary Palestinians, long demoralised by the evaporation of an independent state (the popularity of Fatah and the Palestinian Authority, their rivals in the West Bank, has slumped).

"Now, they came to the fork in the road which Israel assumed they would get to," says Ziv Bohrer, of the Law Faculty at Bar-Ilan University.

"But on October 7 they made the opposite decision that Israel assumed they would make. They took the risk of losing power and decided to act fully as a terrorist organisation in order to save their legitimacy."

Israel could tolerate rockets being fired from Gaza, especially since its Iron Dome air defence system knocked out most of them, but 7 October threatened Israel’s existence, is the argument.

"There were 3,000 Hamas fighters," says Bohrer. "They had planned beforehand which army base to go into, which village to enter, they knew who was in charge of security in the village and they killed that person first. That shows serious military capacity."

Burnt-out vehicles, destroyed during fighting with Hamas militants, in Kibbutz Kfar Aza

Israel therefore no longer sees Hamas as a force it can deter. In turn, the military establishment has upgraded its understanding of "proportionality" and "military advantage."

"Proportionality requires us to consider in each attack the concrete and direct military advantage attained by the attack versus the anticipated incidental harm to civilians," says Eliav Lieblich, Professor of International Law at Tel Aviv University, "and to refrain from an attack if the latter is excessive in relation to that advantage.

"What seems to me different this time is that, due to the capabilities and motivations revealed in October 7, Israel attributes a much greater 'military advantage’ to Hamas targets than before, which then translates to more harm to civilians tolerated per attack than in previous rounds."

Defining a Hamas target is a different ball game if Israel believes its entire apparatus - both a civilian and military - must be destroyed.

"We are interested in dismantling Hamas and the governmental facilities of Hamas because they facilitate its military activities," says Professor Asa Archer, the philosopher who jointly wrote the IDF’s first code of conduct.

The authorities have not spelled that out explicitly, but leading figures have suggested it’s something Israel has in mind.

"[Hamas] controls every facet of Gaza," Gilad Erdan, Israel’s ambassador to the UN, told the Security Council. "Every member of the so-called ministry of health is Hamas. Many UNRWA [the UN agency for Palestinian refugees] workers in Gaza are themselves members of Hamas."

So far, nearly 100 UNRWA workers have been killed in airstrikes.

Israel’s targeting policy has long been the subject of legal debate, and court cases have significantly shaped international jurisprudence.

The funeral of Hussein Abayat

On 9 November 2000, Hussein Abayat, a senior Fatah activist, was driving on a busy street in the West Bank when an IDF helicopter destroyed his car with three missiles. Abayat and two bystanders were killed.

In 2002, the Public Committee Against Torture in Israel and a Palestinian NGO took the government to court arguing the policy of targeted killing was in breach of International Humanitarian Law.

In 2006, the Israeli Supreme Court delivered its findings.

The court did not conclude that targeted killings were illegal, but held that under "customary" international law civilians were protected against attack if they weren’t taking part directly in hostilities.

The IDF would have to obtain verifiable information that the targets had switched from being civilians to combatants before they were killed - furthermore, arrest, interrogation and trial were preferable.

It was a landmark ruling.

As a result, the International Committee of the Red Cross (ICRC) issued fresh guidelines, stating that only those members of an armed group "who hold a Continuous Combat Function (CCF)" could be targeted legally, ie those individuals who continuously and directly participate in hostilities.

Military lawyers, by contrast, were concerned that in the new world of highly organised terror groups like Hamas, Israel was at a disadvantage: they couldn’t target civilians who were part-time militants, whereas any member of the IDF was a target, whether in uniform or not.

As it turned out, the Israeli government soon began to diverge from the Israeli Supreme Court’s 2006 ruling, arguing that civilians who were formally part of a militant organisation - no matter what function they performed - were legitimate targets.

After the Gaza War of 2014, Israel formalised this policy in a report, contradicting not just its own Supreme Court but also a United Nations investigation into the horrendous level of civilian casualties during the 2014 war.

"The [Israeli] report explicitly stipulates that it is legitimate to attack members of organized armed groups ‘by the sole virtue of their membership,’" wrote Yahli Shereshevsky, a postdoctoral fellow at the‏ Minerva Center for the Rule of Law under Extreme Conditions, in the Michigan Law Review.

Shereshevsky argued that the Israeli government’s more hawkish interpretation of who could be targeted coincided with the Israeli Supreme Court, since 2009, adopting a more deferential attitude to the government of the day, partly due to a belief among some judges that, in the face of increasing international criticism of Israel, the court had to more closely reflect national opinion.

It also appeared that Israel was seeking comfort in the US view of targeted killings, which, since 9/11 and the Obama administration’s drone killings in Afghanistan, took a broader view of the rights of militaries to target civilians who were caught up in armed groups.

Following the 2014 Gaza war the US head of the Joint Chiefs of Staff General Martin Dempsey said Israel had gone "to extraordinary lengths to limit collateral damage and civilian casualties."

In a widely circulated paper, two prominent US military lawyers, Michael Schmitt and John Merriam, described a field visit organised by the IDF in which they were granted unrivalled access to Israeli military planners and to the Gaza theatre, even getting to look at Hamas tunnels.

They spoke glowingly of the IDF’s application of the "proportionality" obligation when it came to approving airstrikes.

They wrote that 300 military lawyers were on hand at any given time (out of a pool of 1,000 experts and analysts from the Military Advocate General Corp), to give the go ahead - or to prevent - an airstrike based on constantly evolving assessments.

"Proportionality is monitored," Schmitt and Merriam concluded, "to the extent feasible, until the moment of weapons release. If significant new intelligence surfaces, a reassessment by all relevant officers involved in the targeting process, including the legal advisor, is required. Whenever feasible, the IDF employs various precautions aimed at avoiding, or at least minimizing, the collateral damage expected from the attack."

Professor Asa Kasher, who wrote the IDF code of ethics, says each case is different and there is no neat formula that equates x number of civilians to x military advantage.

Civil defence teams and civilians conduct a search and rescue operation under the rubbles of demolished buildings in Rafah

"We do it systematically," he told RTÉ News. "It's not because our [airforce] pilot is a saint. Our pilots are excellent people, they are very moral officers, but they do not make the decisions on the spot.

"They come to a certain point after the whole system that minimizes collateral damage has already done its work."

He cites a scenario where a terror target has been located but a school bus full of children appears.

"There is a possibility of hitting [the target], but the airforce says there’s a yellow bus nearby full of children. I don't have to kill him right now. I can wait a couple of hours, let the bus leave and I’ll find him later on.

"But if I insist, I’ve killed dozens of children - that's excessive force. I could have waited."

I ask Professor Kasher how he explains the deaths of 4,000 children at the hands of the Israeli air force.

His response is one that is regularly encountered in Israel: "First of all, I don't accept any figure coming out of Gaza. They're notorious for lying all the time.

"The figure of 4,000 children is really a fabrication. Were we interested in killing innocent people then there wouldn't be 10,000, there would be a million, because it's very easy to target civilian areas and to kill people."

Ziv Bohrer, from the law faculty in Bar-Ilan University, argues the high death toll is a function of Israel’s expanded war aims, and the density of the population in Gaza.

"Israel has a strong strategic interest in minimising civilian casualties, because if the numbers are high then international pressure will force [the IDF] to pull back before they achieve their goals."

He also questions whether or not some of the collapsed buildings and apartment blocks are a result of the instability created by the maze of tunnels running under Gaza.

That Israel has a heavily lawyered system of testing airstrikes against proportionality and distinction principles is not necessarily a biased view.

On 30 October, the International Criminal Court prosecutor Karim Khan acknowledged that Israeli military lawyers were part of a system "intended to ensure their compliance with international humanitarian law".

"They have lawyers advising on targeting decisions, and they will be under no misapprehension as to their obligations, or that they must be able to account for their actions."

However, he added that those lawyers needed to demonstrate they were acting within international law.

To much of the outside world - and to numerous NGOs - Israel is not demonstrating that they are.

Referring to the ICRC position, that in wartime it is inevitable that organised combatants become "intermingled with the civilian population", Amnesty International says a Hamas presence does not change Gaza’s civilian character.

"The fact that Palestinian fighters in Gaza may be located within civilian areas does not in any way negate Israel’s obligations with respect to civilians," says Amnesty, "including the principle of distinction, the prohibition on indiscriminate or disproportionate attacks."

The view in Israel is that not only has Hamas changed the character of Gaza, it has, in the words of law expert Ziv Bohrer, "designed the battlefield in a way that necessarily increases civilian casualties."

In the current climate, with furious demonstrations echoing across cities, there is no chance of a calm deliberation as to whether Israel has abided by the laws of war.

Even if Israel is technically within the bounds of international law, there may have been other ways to respond to the Hamas atrocities of 7 October which did not lead to such catastrophic civilian casualties.

Israel has probably lost the battle of global public opinion, but many Israelis I’ve spoken to in Tel Aviv either say they don’t care (they say they care only about the future of their state or their children) or that the world has always been against them.

What matters is the political impact of the pitiful scenes of death and horror in Gaza and how that is reshaping global attitudes to Israel and the Middle East peace process.

There are hopes that out of the chaos, out of the darkest hour, a peace process might emerge leading to a two-state solution.

Nadav Tamir, a former Israeli diplomat who is now working for the families of Israeli hostages, says a peace process is possible, but that the international community will have to do some very heavy lifting.

His desperate search for optimism is tempered by frustration at not knowing how Israel could or should deal with Hamas in a way that would enhance its security.

"My liberal progressive friends in the world have to understand that Hamas is not just the enemy of Israel, it is the enemy of the Palestinians," he says.

"It's the enemy of peace-loving, life-loving people around the world. Israel has to act against Hamas. But we have to do better to differentiate between Hamas and the Palestinian civilians. I’m not sure what the operational way to do it is."