Sanctions
Hamas's decision to stand in elections in 2006 was a major departure for the movement.
The new government was subjected to tough economic and diplomatic sanctions by Israel and its allies in the West.
A rocket is fired by Palestinian militants in Gaza in November 2012
Image caption
Israeli offensives have reduced but not destroyed the capacity of Gaza's militants to launch rocket attacks
After Hamas ousted Fatah from Gaza in 2007, Israel tightened its blockade on the territory, and rocket-fire and Israeli counter-raids continued.
In December that year, Israel launched Operation Cast Lead - a 22-day offensive aimed, Israel said, at halting rocket attacks from Gaza. More than 1,300 Palestinians and 13 Israelis were killed.
Israel cited the same reason for Pillar of Defence in 2012- which began with an air strike that killed Ahmed Jabari, the Qassam Brigades commander. Some 170 Palestinians - mostly civilians - and six Israelis died in the eight-day conflict.
Palestinian sources say Hamas largely tried to maintain calm after the conflict ended, with the Qassam Brigades not joining in the rocket attacks on Israel.
But Hamas also did not move to halt the rocket fire altogether, apparently because it was concerned that Palestinians would see it as less committed to fighting Israel than rival militant groups, particularly Islamic Jihad.
Rocket fire increased in mid-June 2014 when Israel arrested many Hamas members across the West Bank while searching for three murdered Israeli teenagers.
Then on 7 July, Hamas claimed responsibility for firing rockets at Israel for the first time since 2012, and Hamas and Israel became embroiled in the most intensive fighting for months