The terror attacks by Hamas against civilians who were in their homes and dancing at a concert are being called Israel’s Sept. 11, and that’s a fair comparison.

Let’s hope that Israel responds to this outrage more wisely than we in the United States did to the attack on our country.

There’s a lot of loose talk about eliminating Hamas, and Hamas deserves it. As a journalist who has traveled repeatedly to Gaza, I’m appalled by the sympathy that some Americans and Europeans have shown for a misogynist and repressive terror organization like Hamas. If you care about human rights, you want to see Hamas eliminated.

Yet dismantling terrorist organizations can be harder than it looks and can raise troubling moral questions about collateral damage. The Taliban also deserved elimination, yet in the end it was the United States that was eliminated from Afghanistan. I worry that Israel may charge into Gaza with a ground invasion as thoughtlessly as we plowed into Iraq.

Neal Keny-Guyer, a former chief executive of Mercy Corps, knows Gaza well and thinks it is possible for Israel to kill or capture most Hamas leaders. “But at what cost to civilian lives?” he asked me. He noted that street fighting might well spill over into an uprising in the West Bank and a war on the Lebanon border as well.

Gaza is half the size of New York City and home to some 2.2 million people, almost half of whom are children. Global sympathies are overwhelmingly with Israel in the aftermath of the terror attacks, as they should be, but will that be sustained if a ground invasion leads to thousands of Gazan children dying in house-to-house fighting?

Israelis grieving their dead may not care. The Israeli journalist Haviv Rettig Gur argues that the country has undergone a tectonic shift and is now determined to do what it takes, whatever the cost.

“A safe Israel can spend much time and resources worrying about the humanitarian fallout from a Gaza ground war; a more vulnerable Israel cannot,” he wrote in The Times of Israel on Sunday. Israeli officials have struck a similar tone.

“We are fighting human animals, and we are acting accordingly,” said the Israeli defense minister, Yoav Gallant. Another official was quoted as saying that Gaza would be turned into “a city of tents.”

Rabbi Jonathan Jaffe in Chappaqua, N.Y., issued an open letter noting that Jews have been traumatized by the terror attacks. “Now, Israel will act like any other country would if it was invaded by a bloodthirsty neighbor and its citizens murdered, tortured, kidnapped and mutilated,” he wrote. “And when the world inevitably protests the Jewish use of force, we won’t care.”

I empathize with that trauma and anger. Who can watch the video of Shani Louk, a 22-year-old woman kidnapped by Hamas and paraded half-naked and badly injured in Gaza, and not feel rage?

Yet this mood reminds me of the aftermath of Sept. 11 in the United States, when we sailed into trouble. I wrote column after column warning of the risks of invading Iraq, but Americans brimmed with pain, confidence and resolve. What we needed was a companion dose of humility.

The Middle East is an ongoing education in such humility. Israel originally helped nurture Hamas in Gaza because it thought religious leaders would hang out in the mosque and be less dangerous than nationalist ones. Likewise, Israel’s invasion of Lebanon in 1982 inadvertently laid the seeds for Hezbollah on the northern border.

There’s a reason that four successive Israeli prime ministers have chosen not to invade and occupy Gaza. Urban combat is a nightmare, whether for Americans in Falluja or Russians in Grozny, and civilian casualties are often enormous. That’s particularly true in a place like Gaza, where civilians cannot flee.

If we owe a moral responsibility to Israeli children, then we owe the same moral responsibility to Palestinian children. Their lives have equal weight. If you care about human life only in Israel or only in Gaza, then you don’t actually care about human life.

What that means in practice is difficult to navigate. Israel has a right to respond, and in war, civilians inevitably suffer.

“Today I woke up to see my neighborhood completely wiped off, including the building where I have my apartment,” Wafa Ulliyan, a Gazan aid worker who immigrated to Canada a few years ago, told me. “It became ashes.”

Ulliyan said she doesn’t want to see either Israelis or Palestinians targeted but just wants two states to live in peace. I’ve met plenty of people like her in Gaza — although of course there are also some who celebrate when rockets targeting Israel go off.

I flinch when I hear the defense minister refer to Palestinians as animals. Hamas dehumanized Israelis, and we must not dehumanize innocent people in Gaza.

There will be no optimal solution in Gaza, any more than there was in Afghanistan or Iraq. We are fated to inhabit a world with more problems than solutions, and it’s fair to feel conflicted about next steps. Israel will face hard choices in the coming weeks; its challenge will be to respond to war crimes without committing war crimes.

We don’t want to replicate in Gaza the approach reportedly expressed by an American Army major in Vietnam in 1968: “It became necessary to destroy the town to save it.”

The counsel we Americans should offer Israel is threefold and admittedly difficult to follow. First, Israel has right on its side when it goes after its assailants. Second, urban combat has a poor record in achieving its goals — and a considerable history of horrendous casualties. Third, if your moral compass is attuned to the suffering of only one side, your compass is broken, and so is your humanity.

The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.