By Jeremy Bowen
BBC Middle East editor
Before the Israelis started scaling back their operation in Gaza, one of their officials told the BBC that after what he called the "current round" they wanted to leave no perception that Hamas had come out on top.
As soon as Israel said it was pulling its troops back, Hamas held a victory rally in Gaza.
The Hamas claim was not unexpected. The violence in the last week has been about sending political messages, as much as it has been about changing the military balance.
Hamas wants its people to know that nothing will stop it resisting Israel.
Israel would like to stop the rocket fire that has been hitting its border towns since it ended its permanent military presence in Gaza in 2005.
But almost constant raids - and several big offensives - have not been able to do the job.
That is why the Israeli government has so far resisted strong domestic pressure from its political opponents for a much more far-reaching - and bloody - offensive.
So instead it wants to show its people that attacks will not go unanswered - and to try to win an argument around the world that it is only reacting as any country under fire would do.
Rice in talks
It looks as if the United States now believes that Israel has made its point, and that it should stop before any more damage is done to the peace talks that it is sponsoring between Israel and the Palestinian Authority President Mahmoud Abbas and his team.
The Palestinian side suspended them over the weekend, in protest at what one senior negotiator told the BBC were massacres in Gaza.
Secretary Rice must know that the talks will not produce anything if there is a war in Gaza.
US Secretary of State Condoleezza Rice is due in Jerusalem on Tuesday. She wants the talks to restart.
But the last few days have shown how vulnerable those talks are to events - especially when Hamas in Gaza, who are boycotted by Israel and the big western countries, have no interest in seeing them succeed.
Ms Rice, who is committed to trying to realise George Bush's "vision" of a comprehensive peace deal by the end of the year, must know that the talks will not produce anything if there is a war in Gaza.
The best way to understand the violence that is washing back and forth between Gaza and Israel is to go back to first principles.
It is the latest episode in a conflict that has lasted about a century. It started because two different peoples wanted one piece of land.
They are still working their way through the consequences of that single fact.
When you take the long view you realise how hard it will be to stop the killing.
Never leaving an attack unanswered is a basic instinct in a state whose founders believed that they had abandoned centuries of Jewish weakness when they left Europe to build something new and strong in the land of Israel.
The Palestinians of Hamas, who run things inside the Gaza strip, say that their right to resist, to defend their people, is absolute.
They believe that their rivals in Fatah, the other main Palestinian faction, were ready to sell their birthright in negotiations with Israel that amounted to surrender. They say that they will not make the same mistake.
What is going on between the Palestinian rocket squads in Gaza and the Israeli army is a classic fight between the strong and the weak - which is known these days as asymmetric warfare.
The thing about it is that the weaker side can exert leverage far beyond the power of its weapons.
That accounts for some of the rage and frustration in Israel's defence establishment.
They are big, they are strong, and they have some of the most sophisticated weapons systems in the world. And they are struggling to stop rockets that are the lowest of low tech.
That is probably why Israeli deputy Defence Minister Matan Vilnai used the word holocaust last week to describe what would happen to the Palestinians if the rocket fire intensified.
His spin-doctor moved fast to say that the deputy minister, a retired major general, did not mean genocide.
There are people inside Hamas who listen to Israel's threats and in the unfortunate phrase used by President Bush about Iraq, say "Bring it on".
The religious warriors of Hamas do not fear death, and believe they can do some damage.
What upped the stakes in the last week was the death of an Israeli in Sderot, the battered Israeli border town.
It was also the fact that Hamas showed it could rocket Ashkelon, a city of 120,000 people.
The Israelis say that the longer-range rockets came from Iran, which for them makes matters even worse.
Israel believes it is in the front line of a conflict between the western world and Islamic militants, led by Iran.
So if Ashkelon keeps getting hit, even though few Israelis believe it's a perfect solution, expect more military action once the US Secretary of State Condoleezza Rice leaves town.