Hamas is the largest of several Palestinian militant Islamist groups.
Its name is an Arabic acronym for the Islamic Resistance Movement, originating as it did in 1988 after the beginning of the first Palestinian intifada, or uprising, against Israel's occupation of the West Bank and Gaza Strip. Under its charter, it is committed to the destruction of Israel.
Hamas originally had a dual purpose of carrying out an armed struggle against Israel - led by its military wing, the Izzedine al-Qassam Brigades - and delivering social welfare programmes.
But since 2005, when Israel withdrew its troops and settlers from Gaza, Hamas has also engaged in the Palestinian political process. It won the legislative elections in 2006, before reinforcing its power in Gaza the following year by ousting the rival Fatah movement of President Mahmoud Abbas.
Since then, militants in Gaza have fought four major conflicts with Israel, which along with Egypt has maintained a blockade on the strip to isolate Hamas and to pressure it to stop attacks.
Hamas as a whole, or in some cases its military wing, is designated a terrorist group by Israel, the United States, European Union and United Kingdom, as well as other powers.
Hamas came to prominence after the first intifada as the main Palestinian group opposed to the Oslo peace accords signed in the early 1990s between Israel and the Palestine Liberation Organisation (PLO), the body representing most Palestinians.
Despite numerous Israeli operations against it and clampdowns by the Palestinian Authority (the main governing body of the Palestinians) Hamas found it had an effective power of veto over the process by launching suicide attacks.
It carried out multiple bus bombings, killing scores of Israelis, and stepped up its attacks after Israel assassinated its chief bomb maker Yahya Ayyash in December 1995.
The bombings were widely blamed for turning Israelis off the peace process and bringing Benjamin Netanyahu - a staunch opponent of the Oslo accords - to power in 1996.
In the post-Oslo world, most particularly following the failure of US President Bill Clinton's Camp David summit in 2000 and the second intifada which followed shortly thereafter, Hamas gained power and influence as Israel clamped down on the Palestinian Authority, which it accused of sponsoring deadly attacks.
Hamas organised clinics and schools, which served Palestinians who felt let down by the corrupt and inefficient Palestinian Authority, dominated by the Fatah faction.
Many Palestinians cheered the wave of Hamas suicide attacks in the first years of the second intifada. They saw "martyrdom" operations as avenging their own losses and Israel's settlement-building in the West Bank, territory wanted by Palestinians for a future state of their own.
In March and April 2004, Hamas spiritual leader Sheikh Ahmed Yassin and his successor Abdul Aziz al-Rantissi were assassinated in Israeli missile strikes in Gaza.
The death of Fatah leader Yasser Arafat that November saw the Palestinian Authority newly led by Mahmoud Abbas, who viewed Hamas rocket-fire as counter-productive.
When Hamas scored a landslide victory in Palestinian parliamentary elections in 2006, the stage was set for a bitter power-struggle with Fatah.
Hamas resisted all efforts to get it to sign up to previous Palestinian agreements with Israel, as well as to recognise Israel's legitimacy and to renounce violence.
The 1988 charter
Hamas's charter defines historic Palestine - including present-day Israel - as Islamic land and it rules out any permanent peace with the Jewish state.
The document also repeatedly makes attacks on Jews as a people, drawing charges that the movement is anti-Semitic.
In 2017, Hamas produced a new policy document that softened some of its stated positions and used more measured language.
There was no recognition of Israel, but it did formally accept the creation of an interim Palestinian state in Gaza, the West Bank and East Jerusalem - what are known as pre-1967 lines.
The document also stresses that Hamas's struggle is not with Jews but with "occupying Zionist aggressors". Israel said the group was "attempting to fool the world".
As a result, the new Hamas-led government was subjected to tough economic and diplomatic sanctions by Israel and its allies in the West.
After Hamas ousted forces loyal to Fatah from Gaza in 2007, Israel tightened its blockade on the territory, and Palestinian rocket-fire and Israeli air strikes continued. Egypt also closed its border crossing with Gaza and has only opened it intermittently since.
Israel holds Hamas responsible for all attacks emanating from the strip, and the two sides have been in a constant state of conflict ranging from deadly incidents around the border to full-scale hostilities.
The deadliest round, in 2014, saw at least 2,251 Palestinians, including 1,462 civilians, killed during 50 days of fighting. On the Israeli side, 67 soldiers and six civilians were killed.
Most recently, an 11-day conflict in May 2021 killed at least 256 people in Gaza and 13 in Israel before it ended with an Egyptian-brokered truce.
Repeated attempts at reconciliation between Hamas and Fatah have failed, and the first Palestinian elections for 15 years, in which Hamas was due to compete, were called off by President Abbas in April 2021.
Meanwhile, the humanitarian situation for the two million Palestinians in Gaza has deteriorated. The strip's economy has collapsed, and there are shortages of water, electricity and medicine.