(CNN) -- However crude the calculation, especially amid all the civilian casualties, the winners and losers in the Israel-Gaza conflict are already reshaping political alliances in the Middle East.
Before the last rocket was fired, before U.S. Secretary of State Hillary Clinton announced the cease-fire, there was already a consensus building among stakeholders and analysts that the events of the last week have transformed the fortunes of many in the Middle East.
Egyptian President Mohamed Morsy, clearly underestimated, deftly navigated what is a minefield of competing interests, including those of his own country.
"For a civilian president in Egypt perceived as a weak leader, he has, much to everyone's surprise, delivered," says Aaron David Miller, a Middle East scholar at the Woodrow Wilson Center.
Morsy proved he has the leverage necessary to bring Hamas to the table and get its leadership to agree to a cease-fire. Brokering that deal has given him much needed political capital in both the Arab world and the United States.
This was a qualified victory as well for Israel and its tenacious Prime Minister Benjamin Netanyahu. Just months before an election, Netanyahu's government targeted and killed Hamas' military leader, Ahmed al-Jaabari. Hundreds of airstrikes on Gaza followed, but the real victory here might have been the combat debut of Iron Dome, the U.S.-funded defense shield that kept dozens of Hamas rockets from hitting Israeli civilians.
Ironically, though, Hamas has emerged emboldened from this conflict and its truce.
"Hamas has emerged stronger, it has consolidated its control over Gaza and it has gained now more legitimacy," explains Miller.
In the eyes of the Palestinian people, the militant leaders of Gaza took on Israel more boldly than ever before, firing rockets farther than ever before. And they may yet manage to get an easing of the Gaza economic blockade if a more comprehensive deal can be reached.
"Look what they accomplished; they, rather than (President Mahmoud) Abbas, has put the Palestinian issue back on the international stage," says Miller.
Palestinian Authority President Mahmoud Abbas and his Fatah faction have lost much in this conflict. He was supposed to be the moderate peace broker who could finally forge a new deal with Israel. Now he cannot even claim to speak for all Palestinians and has shown that he has no leverage with Hamas, his archrival.
And then there's Iran, on the outside looking in but always a player when it comes to Hamas. Iran's hand now arguably has been weakened after this episode. The Iron Dome shot hundreds of its missiles out the sky.
While Israel has always accused Iran of smuggling weapons to Hamas through the Egyptian border, Iran today implicitly confirmed it.
"Gaza is under siege, so we cannot help them. The Fajr-5 missiles have not been shipped from Iran. Its technology has been transferred (there) and are being produced quickly," Mohamed Ali Jafari, the head of Iran's Revolutionary Guard, is quoted as saying by the Iranian news agency ISNA.
The question now: If Israel attacks Iran, can Iran still call on Hamas to retaliate with missiles or have they been rendered ineffective with an ever-improving Iron Dome?
In just a matter of days, with one truce, allies and enemies in the region have shifted, and this will certainly affect any future peace negotiations.