HAMAS has ruled Gaza since 2007 and there is not much to admire. The Islamist party is harsh, narrow-minded and intolerant of dissent. Its charter is anti-Semitic. It fires rockets into Israeli territory and builds tunnels under it to kill or kidnap Israeli soldiers. It knows that the Israeli attacks it provokes will kill hundreds of Palestinian civilians, which will garner sympathy around the world. It is also weaker than it was, for it is now losing the military battle against Israel.

By contrast Israel is the most successful state in the Middle East. It is the region’s only true democracy—a hub of invention, enterprise and creativity. Israel has overwhelming firepower in the fight in Gaza. Most of its people are united behind their soldiers and have the firm backing of America’s Congress. Yet, though Israel is winning the battle, it is struggling in the war for world opinion (see article). That matters in part because Israel is a cosmopolitan trading country that looks to its American ally for security, but also because Israel needs to hear some of what its critics are saying.

Anti-Semitism: a very light sleeper

A generation ago, Israel had the best of the argument with Yasser Arafat’s Palestine Liberation Organisation, in many ways a less vile outfit than Hamas. Young Europeans spent their gap years on kibbutzim. The Western world cheered when Israeli commandos rescued Jewish hostages from the terminal building in Uganda’s Entebbe airport in 1976.

But as the occupation of Palestinian territory has dragged on, sympathy has seeped away. In a poll published in June, before the destruction of Gaza, the citizens of 23 countries put the balance of those who think Israel is a good or bad influence on the world at minus 26%, ranking it below Russia and above only North Korea, Pakistan and Iran. A growing number of Europeans call Israel racist (with the sinister flourish that Israelis, of all people, should know better). And even in America, where a solid majority backs Israel, the share that thinks its actions against the Palestinians are unjustified has risen since 2002 by five percentage points, to 39%. Among 18- to 29-year-olds, Israel is backed by just a quarter.

Many Israelis, and their most fervent supporters in Congress, see today’s hostility as the culmination of a long process of demonisation, double standards and delegitimisation. They have a point. Holding a country to high standards, as Israel’s critics do, can be a compliment—yet against Israel, morality is often used as a cudgel. The common slur that Israel is an apartheid state ignores the fact that Israel’s minorities, such as the Druze, Arabs and Bahais, are protected by the country’s independent courts—including the highest, which has a sitting Arab Israeli judge. The “BDS” campaign to impose boycotts, encourage divestment and introduce sanctions calls not just for an end to the occupation of the West Bank and for equal rights, but also for the right of return of all Palestinian refugees—in other words, for the erosion of Israel as a Jewish homeland. Protests in France against the fighting in Gaza led to attacks on synagogues and Jewish-owned businesses.

No wonder that many Israelis feel that the world is against them, and believe that criticism of Israel is often a mask for antipathy towards Jews. But they would be wrong to ignore it entirely. That is partly because public opinion matters. For a trading nation built on the idea of liberty, delegitimisation is, in the words of an Israeli think-tank, “a strategic threat”. But it is also because some of the foreign criticism is right.

Please, hear them

That begins with the scale of the violence in Gaza. Some 1,400 Palestinians have died in the past few weeks, compared with 56 Israeli soldiers and four civilians. Even allowing for Hamas’s brutality, no democracy should be happy with a military strategy that results in the death of so many children (let alone the crass claim from Israel’s ambassador to Washington that its soldiers deserve a Nobel peace prize). The destruction is driving support towards Hamas and away from the moderate Palestinians who are Israel’s best chance for peace.

But more than that, Israel needs to hear what its critics say about the need for a two-state solution, which remains the only one that will work. Time is not on Israel’s side. Palestinians may already outnumber Israelis in the lands they share. Without two states, Israelis and Palestinians will be left with one that contains them both. The risk for Israel is of either a permanent, non-democratic occupation that disenfranchises Palestinians, or a democracy in which Jews are in a minority. Neither would be the Jewish homeland with equal rights for all that Israel’s founding fathers intended.

America’s secretary of state, John Kerry, has made a Herculean effort to forge peace between the Israelis and the Palestinians along the lines of two states for two peoples. When the talks broke down, a few months ago, he blamed Israel’s settler lobby. That outraged right-wing Israelis. And now the left has joined in the derision because he proposed a ceasefire in Gaza that Israelis thought favoured Hamas. But Mr Kerry is right. If Israel continues to build settlements in the occupied territory, it will gobble up land that would belong to an independent Palestinian state, making peace harder to reach.

The same goes for what appears to be Israel’s strategy towards both Gaza and the West Bank. Having created a huge open-air prison in Gaza, Israel remains committed to a blockade that contains Hamas—but also ensures that ever more Palestinians grow up angry. On the West Bank, Israel’s prime minister, Binyamin Netanyahu, has gone backwards: he has said that Israel cannot relinquish security control of the West Bank for fear of Islamist attack. That implies an intention to consolidate the occupation, thus withdrawing all hope from Palestinian moderates. The West Bank would be likely to explode too, then, while the demographic clock ticked on.

For all the blood and misery in Gaza, Mr Netanyahu will soon have a chance to show he has heard the critics. Having won his battle, he could return to the negotiating table, this time with a genuine offer of peace. Every true friend of Israel should press him to do so.