The latest conflict in Gaza put Hamas in a delicate position, forcing it to weather criticism from other groups as it sought a quick truce to avoid a full-blown war, analysts said.
The four-day flare-up that began with Israel's assassination of the leader of the radical Popular Resistance Committees quickly turned into tit-for-tat violence, with Israel launching multiple air strikes as militants hit back with rockets.
But throughout the conflict, which ended early on Tuesday with a ceasefire after claiming 25 Palestinian lives, Hamas officials said they were working to restore a tacit truce.
And it also kept its fighters out of the battle, despite criticism from other factions.
"Hamas is now in power, and governing involves more rationality and responsibility," said Mukhaimer Abu Saada, a political science professor at Gaza's Al-Azhar University.
"They wanted to protect the truce because they don't want to be dragged into a war in which they would be the biggest loser."
But the latest confrontation put Hamas in the awkward position of trying to rein in the "resistance" it has long espoused, political analyst Akram Atallah said.
"What happened is a big embarrassment for Hamas, which faced two options: either rush into a battle that would lead to a major escalation, which would threaten their people, institutions and power, or to sit on the fence, which is what happened, and leave Islamic Jihad by itself in the battle," he told AFP.
"The first option is very costly for Hamas and could cost it its power in Gaza," he explained saying the Islamist movement was anxious to avoid a repeat of Israel's devastating 22-day operation over New Year 2009, which ended with the deaths of 1,400 Palestinians, more than half of them militants.
But Hamas's position didn't go unnoticed by other factions, with Islamic Jihad even taking a public sideswipe at its efforts to end the violence through Egyptian mediation with Israel.
"We call on those panting after any calm, whatever its conditions, to direct their messages at the enemy and not the resistance, for there is no calm after today, except based on the conditions of the resistance," the group warned at the height of the fighting.
Hamas spokesman Taher al-Nunu rejected the criticism, denying the Islamic movement had abandoned "resistance."
"Hamas responds at the time and in the manner that it considers most effective," he told AFP.
"Resistance is a strategic choice and, on the contrary, the government has created an environment that supports resistance," he said, pointing out that Hamas had given armed groups "a free hand to respond to the crimes of the occupation."
Signup to our newsletter and follow us on Facebook and Twitter!
Naji Shurrab, a professor of political science at Al-Azhar University, said Hamas was effectively forced to allow militants from Islamic Jihad and other groups to fire rockets at Israel.
"It allowed the factions to respond so it wouldn't contradict its stated position on the resistance and would not appear to be abandoning the option of resistance," he said.
According to a source close to Hamas, the group had taken a strategic decision not to participate in the fighting.
"It's a message from Hamas to Israel and to the international community," he said. "The message is that Hamas is not the aggressor and is not seeking a war."
Hamas had learned from earlier experiences, he said.
"It is trying to embarrass the Israeli government and show the international community that it has changed."
The Islamist movement was confident it had public support, he said.
"People in Gaza don't want a war, and Hamas knows that and it doesn't want a war. And any group can say anything they want, but the only group that can enter a real war with Israel is Hamas."
"Hamas is not interested in an escalation in the Gaza Strip because there is no possible political advantage for it," he added.
Despite Hamas's public confidence, its stated terms for a new ceasefire with Israel suggested the desire to win a victory in the eyes of its constituents.
Officials said they would only agree to a ceasefire if Israel pledged to avoid future assassinations -- a term that had not previously been insisted upon.
"Hamas is extremely embarrassed about requiring the factions to stop firing rockets without an Israeli commitment not to break the truce or carry out assassination operations," Abu Saada said.
Egyptian officials who announced the truce early on Tuesday said it contained an Israeli pledge to end assassinations -- but Israel denied giving such assurances.
Shortly after the truce came into effect, Hamas said that "any Israeli violation requires a strong response by all factions."