The Oct. 7 attack on Israelis by Hamas militants was an unspeakable act of terrorism and Israel has every right to use military force to prevent future such atrocities. But in doing so it must stay true to its values by doing everything possible to minimize the suffering of innocent Palestinian residents of Gaza.

That seemed to be President Biden’s message for Israelis when he spoke Wednesday in Tel Aviv, reminding his hosts that “the vast majority of Palestinians are not Hamas. Hamas does not represent the Palestinian people.”

Biden expressed solidarity with the Israeli people and promised that he would ask Congress for “an unprecedented support package for Israel’s defense.” He adroitly combined that statement of support with a gentle but unmistakable plea for Israel to achieve “clarity about the objectives and an honest assessment about whether the path you’re on will achieve those objectives.” This is the appropriate role for the U.S. to play at this stage.

The president recalled that after 9/11: “We were enraged in the United States. While we sought justice and got justice, we also made mistakes.”

Israel should take that wise counsel to heart as it continues its campaign to destroy Hamas, which might soon involve an invasion of Gaza. … That Israel does not target civilians is small comfort for the families of those killed or wounded.

Nor can civilians be sure that relocating will spare them from harm. The New York Times reported this week that Palestinians who heeded an Israeli order to evacuate portions of the Gaza Strip and head south are enduring airstrikes even after they have moved.

Biden also announced that Israel had agreed to allow humanitarian assistance to enter Gaza from Egypt. It’s appalling that trucks laden with food and supplies have been stalled in Egypt near the Gaza border. He also promised an additional $100 million in humanitarian assistance for Gaza and the West Bank.

The president had hoped on this visit to the Middle East to meet in Jordan with Palestinian Authority President Mahmoud Abbas and Egyptian President Abdel Fattah Sisi. But the meeting was canceled after Abbas withdrew following an explosion at a hospital in Gaza … Biden said that the U.S. believes that the explosion was the result of “an errant rocket fired by a terrorist group in Gaza,” as Israel has insisted.

Finally, it’s important that Biden in his remarks Wednesday expressed support for the elusive two-state solution in which Israel would peacefully coexist with a Palestinian state. He indicated that his administration would continue to “keep working for Israel’s greater integration with its neighbors.”

Now as so often in the past, the United States must balance its support for Israel with its mission of promoting peace and cooperation in a volatile region. The vicious attack by Hamas and its awful aftermath make that quest more, not less, urgent.