Enemies of Israel, who are seeking to justify Hamas rocket and tunnel attacks against Israeli civilians, are mendaciously claiming that Israel has continued to occupy the Gaza Strip, even after its soldiers and settlers left the Strip in 2005. They claim that because Gaza was unlawfully still occupied, despite the absence of Israeli soldiers, resistance to the occupation – including the murder of Israeli civilians – is justified as a matter of international law. This claim is wrong for several independent reasons.First, it is never justified to target and murder enemy civilians. Even if Israel did have a military occupation, as it does in the West Bank, it would still be a double war crime to fire rockets at Israeli civilians, using Palestinian civilians as human shields.It would also be a war crime to murder or kidnap Israeli civilians. The only legitimate resistance to occupation is to target the soldiers who enforce the occupation.Second, a military occupation of Gaza – as distinguished from civilian settlements – would be entirely justified, both as a matter of law and common sense, because Hamas, which controls Gaza, is at war with Israel and has repeatedly refused to make peace with the nation-state of the Jewish people. A military occupation is proper as long as a state of war exists.Third, and even more important for any future peace, is the indisputable fact that Israel, in fact, ended its occupation of Gaza in 2005.The years between 2005 and the present must be divided into three time periods: 2005- 2007; 2007-beginning of July 2014; and the beginning of July 2014 to the present.During the first period (2005-2007), Israel removed all of its troops from Gaza.It also removed all of its settlers.The settlers left behind greenhouses, farm equipment and other valuable civilian assets worth millions of dollars.The Palestinians of Gaza were free to come and go as they pleased, to conduct free elections, and to import construction and other economic material in order to build a viable Palestinian entity to help their citizens. European donors sent them money and other resources, hoping that they would use them to create jobs, schools, hospitals and other necessary infrastructure.To be sure, Israel maintained control over its border with Gaza, with checkpoints and security fences, but it opened its border to Palestinian residents of Gaza who came to work in Israel. During that period, numerous Gazans came into Israel to work and came back to Gaza with good salaries to feed their families.During the same period many Gazans went to Egypt and other countries.Israel continued to control Gaza’s air space and to patrol its sea lanes in order to prevent the importation of rockets and other weapons capable of being used against Israeli civilians, but it had no presence on the ground in Gaza.On January 25, 2006, the Palestinian Authority held elections. Gazans were free to vote and did in fact vote in large numbers for Hamas, which achieved a significant political victory. But that wasn’t enough for Hamas, which conducted a bloody coup d’etat in which numerous Palestinian civilians who were associated with the Palestinian Authority were killed. Hamas also resumed rocket attacks against Israeli civilians and increased its building of terrorist tunnels into Israel, which it used to kill and kidnap Israelis. It was only after these acts of war by Hamas that Israel instituted its blockade in 2007 – nearly two years after it ended its occupation.So the truth is that the blockade has not been the cause of Hamas’ rocket and tunnel attacks. The blockade has been the result of these attacks. It is an entirely legitimate defensive military response to war crimes committed by Hamas.Yet there are some – including Mark Lamont Hill and Peter Beinart, with whom I debated on CNN – who insist that Israel continued to “occupy” Gaza unlawfully between 2005 and 2007, before it instituted its blockade.It’s this kind of rigid, unnuanced argument that makes a compromise peace so difficult.Finally, we come to the recent war. Israel did not send soldiers into Gaza, until after Hamas sent its terrorists into Israel through its tunnels and killed Israelis. It became clear to Israel that it could not tolerate these tunnels, whose exits are located near kindergartens, kibbutzim and other civilian areas. Nor could these tunnels be attacked from the air, since their entrances are beneath hospitals, schools, mosques and civilian homes – and their exit locations are unknown to the Israelis.The only way to shut down these tunnels of death is by Israeli boots on the ground, and with grave risks to the lives of Israeli soldiers. But Israel had little choice but to attack these tunnel entrances before they could be used as planned: to murder hundreds, if not thousands of Israeli civilians and to kidnap Israeli soldiers and civilians.Despite these indisputable realities, Israel’s defamers insist that: A) Gaza has been continuously occupied since its soldiers and settlers left in 2005; B) Israel’s continued occupation is unlawful; and C) This unlawful occupation justifies Hamas’ war crimes, including rocket and tunnel attacks on Israel’s civilians from behind Palestinian human shields.If any of these claims were to be credited by the international community, a twostate solution would become impossible, because there is no way Israel would, or should, end its military occupation of the West Bank, without maintaining some degree of military control over its security borders. No Israeli government – Right, Left or Center – would make a deal with the Palestinian Authority that left its citizens and its airport vulnerable to rocket or tunnel attacks of the kind they have experienced from Gaza since leaving in 2005. Nor would, or should, the United States ever ask Israel to accept any deal that did not assure its security, especially in light of the instability in Syria, Iraq and much of the rest of the Arab and Muslim world.Those who refuse to credit Israel for unilaterally removing all of its settlers and all of its soldiers from Gaza because it retained some security control over its borders are discouraging Israel from taking further risks for peace.The perfect is enemy of the good, and to demand a total end to any Israeli military control over its vulnerable and dangerous borders is to assure that a good, if imperfect, peace deal will never take place. That is the goal of Hamas. It is also the goal of some Israeli extremists.Those who falsely argue that Israel continued to occupy Gaza after its soldiers left and before it imposed its necessary blockade are playing into the hands of the enemies of a compromise peace.The author’s latest book is Taking the Stand: My Life in the Law.