|Ancient history until mid 16th century (15th century BC-1517)
The first recorded mention of the city of Gaza was a reference by Pharaoh Thutmose II (18th dynasty; 15th century BC), though the actual habitation no doubt predates that official record. It is also mentioned in the Amarna letters, an archive of clay tablets with diplomatic and administrative correspondence between the Egyptian administration and its representatives in Canaan and Amurru in the New Kingdom.
Because of its strategic position on the ancient trade route of Via Maris, linking Egypt with the northern empires of Syria, Anatolia and Mesopotamia, Gaza experienced little peace in antiquity. Throughout its history it was a prosperous trade center, sitting as it does on the ancient Sea Road.
The area was under Egyptian occupation for over 300 years when the Philistines took control and settled the city and surrounding area. Gaza became an important Philistine trading center and part of the Pentapolis (league of five cities).
The Bible makes a reference to Gaza as the place where Samson was delivered into bondage by Delilah and where he died while toppling the temple of the god Dagon. It fell to the Israelite King David in 1000 BC.
The area fell to the Assyrians in 732 BC, to the Egyptians, to the Babylonians in 586 BC, Persians in 525 BC, and the Macedonians. Macedonian ruler Alexander the Great met stiff resistance there in 332 BC. After conquering it, he sold its inhabitants into slavery.  
In 145 BC Gaza was conquered by Jonathan the Hasmonean (Brother of Judah the Maccabee). In Hellenistic and Roman times the harbour, about 3 miles (5 km) from the city proper, was called Neapolis (Greek: “New City”).
It was conquered by Arabs in the 630s after a siege during which the Jewish population of the city defended it alongside the Byzantine garrison. Believed to be the site where Muhammad’s great grandfather was buried, the city became an important Islamic center. In the 12th century, Gaza was taken by Christian Crusaders; it returned to Muslim control in 1187.
Ottoman and British control (1517-1948)
In 1517 Gaza fell to the Ottomans and was part of the Ottoman Empire until the First World War.
Starting in the early 19th century, Gaza was culturally dominated by neighboring Egypt. Though part of the Ottoman Empire, a large number of its residents were Egyptians (and their descendants) who had fled political turmoil.
The region served as a battlefield during the First World War (1914-18). The Gaza Strip was taken by the British in the Third Battle of Gaza on 7 November 1917.
Following World War I, Gaza became part of the British Mandate of Palestine under the authority of the League of Nations.
Jews were present in Gaza until 1929, when a long-running dispute between Muslims and Jews over access to the Western Wall in Jerusalem escalated and erupted into a series of violent demonstrations and riots and forced the Gaza Jews to leave the area. After that the British prohibited Jews from living in the Gaza area, though some Jews returned and, in 1946, established kibbutz Kfar Darom near the Egyptian border. 
British rule of Palestine ended with the Israeli War of Independence in 1948.
Egyptian occupation (1948-67)
According to the terms of the 1947 United Nations partition plan, the Gaza area was to become part of a new Palestinian Arab state. Following the dissolution of the British mandate of Palestine and 1947-1948 Civil War in Palestine, Israel declared its independence in May 1948. The Egyptian army invaded the area from the south, starting the 1948 Arab-Israeli War.
The Gaza Strip as it is known today was the product of the subsequent 1949 Armistice Agreements between Egypt and Israel, often referred to as the Green Line. Egypt occupied the Strip from 1949 (except for four months of Israeli occupation during the 1956 Suez Crisis) until 1967. The Strip’s population was greatly augmented by an influx of Palestinian Arab refugees who fled or were expelled from Israel during the fighting.
Towards the end of the war, the All-Palestine Government (Arabic: حكومة عموم فلسطين hukumat ‘umum Filastin) was proclaimed in Gaza City on 22 September 1948 by the Arab League. It was conceived partly as an Arab League attempt to limit the influence of Transjordan over the Palestinian issue. The government was not recognized by Transjordan or any non-Arab country. It was little more than a façade under Egyptian control, had negligible influence or funding, and subsequently moved to Cairo. Palestinians living in the Gaza Strip or Egypt were issued All-Palestine passports until 1959, when Gamal Abdul Nasser, President of Egypt, annulled the All-Palestine government by decree.
Egypt never annexed the Gaza Strip, but instead treated it as a controlled territory and administered it through a military governor. The refugees were never offered Egyptian citizenship.
During the Sinai campaign of November 1956, the Gaza Strip and the Sinai Peninsula were overrun by Israeli troops. International pressure soon forced Israel to withdraw.
Israeli occupation (1967-2005)
Israel occupied the Gaza Strip again in June 1967 during the Six-Day War. The military occupation lasted for 38 years, until 2005. However, Israel retains control of air space, territorial waters, offshore maritime access, the population registry, entry of foreigners, imports and exports as well as the tax system.
During the period of Israeli occupation, Israel created a settlement bloc, Gush Katif in the south west corner of the Strip near Rafah and the Egyptian border. In total Israel created 21 settlements in the Gaza Strip, comprising some 20% of the total terroritory. Besides ideological reasons for being there, these settlements also served Israel’s security concerns. The Gaza Strip remained under Israeli military administration until 1994. During that period the military administration was also responsible for the maintenance of civil facilities and services.
In March 1979 Israel and Egypt signed the Israel-Egypt Peace Treaty. Among other things, the treaty provided for the withdrawal by Israel of its armed forces and civilians from the Sinai Peninsula which Israel had captured during the Six-Day War. The final status of the Gaza Strip as with relations between Israel and Palestinians was not dealt with in the treaty. The treaty did settle the international border between Gaza Strip and Egypt. Egypt renounced all territorial claims to the region beyond the international border.
In May 1994, following the Palestinian-Israeli agreements known as the Oslo Accords, a phased transfer of governmental authority to the Palestinians took place. Much of the Strip (except for the settlement blocs and military areas) came under Palestinian control. The Israeli forces left Gaza City and other urban areas, leaving the new Palestinian Authority to administer and police the Strip. The Palestinian Authority, led by Yasser Arafat, chose Gaza City as its first provincial headquarters. In September 1995, Israel and the PLO signed a second peace agreement extending the Palestinian Authority to most West Bank towns. The agreement also established an elected 88-member Palestinian National Council, which held its inaugural session in Gaza in March 1996.
The PA rule of the Gaza Strip and West Bank under leadership of Arafat suffered from serious mismanagement and corruption. Exorbitant bribes were demanded for allowing goods to pass in and out of the Gaza Strip, while heads of the Preventive Security Service apparatus profited from their involvement in the gravel import and cement and construction industries, like the Great Arab Company for Investment and Development, the al-Motawaset Company and the al-Sheik Zayid construction project. 
The Second Intifada broke out in September 2000. In February 2005, the Israeli government voted to implement a unilateral disengagement plan from the Gaza Strip. The plan began to be implemented on 15 August 2005 (the day after Tisha B’av) and was completed on 12 September 2005. Under the plan, all Israeli settlements in the Gaza Strip (and four in the West Bank) and the nearby Erez bloc were dismantled with the removal of all 9,000 Israeli settlers (most of them in the Gush Katif settlement area in the Strip’s southwest) and military bases. On 12 September 2005 the Israeli cabinet formally declared an end to Israeli military rule in the Gaza Strip. To avoid any allegation that it was still in occupation of any part of the Gaza Strip, Israel also withdrew from the Philadelphi Route, which is a narrow strip adjacent to the Strip’s border with Egypt, after Egypt’s agreement to secure its side of the border. Under the Oslo Accords the Philadelphi Route was to remain under Israeli control, to prevent the smuggling of materials (such as ammunition) and people across the border with Egypt. With Egypt agreeing to patrol its side of the border, it was hoped that the objective would be achieved.
Palestinian Authority control (2005-2007)
In accordance with the Oslo Accords, the Palestinian Authority took over the administrative authority of the Gaza Strip (other than the settlement blocs and military areas) in 1994. After the complete Israeli withdrawal of Israeli settlers and military from the Gaza Strip on 12 September 2005, the Palestinian Authority had complete administrative authority in the Gaza Strip.
Since the Israeli withdrawal the Rafah Border Crossing has been supervised by EU Border Assistance Mission Rafah under an Agreement finalised in November 2005.
Israel continues to assert control over activities that rely on transit through Israel, as well as air space over and sea access to ports in Gaza. Israel approves all immigration to and emigration from Gaza via Israel, as well as entry by foreigners via Israel, imports and exports via Israel, and collection and reimbursement of value-added tax in Israel.
Palestinians and others maintain that the Israeli occupation is not over because of this Israeli control. The Israeli human rights organization B’tselem said in November 2006 that “the broad scope of Israeli control in the Gaza Strip creates a strong case for the claim that Israel’s occupation of the Gaza Strip continue.” University of London, School of Oriental and African Studies, law professor Iain Scobbie noted in 2006 that “Israel retains absolute authority over Gaza’s airspace and territorial sea. It is manifestly exercising governmental authority in these areas…. it is clear that Israeli withdrawal of land forces did not terminate occupation.” And according to some Palestinians, Israel’s occupation of the Gaza Strip continued. “They control the water, the sky and the passages. How can you say occupation is over?” said Palestinian negotiator Saeb Erekat in 2005. Similar viewpoints have been presented by many other Palestinian organizations and leaders. The Al Mezan Center for Human Rights also argues that the Gaza Strip remains occupied by Israel.
Prior to Israel’s withdrawal from the Gaza Strip, the United States considered the Gaza Strip to be an Israel-occupied territory. Following the withdrawal, no official US government statement has been made on the status of the Strip. However, the CIA World Factbook (an official U.S. government publication), which was last updated in 2007, continues to list the Gaza Strip as an Israeli-occupied territory.
On the other hand, Israel and others claim that Gaza is no longer occupied as it doesn’t exercise effective control or authority over any land or institutions in the Gaza Strip. According to the The Hague convention of 1907 ‘Territory is considered occupied when it is actually placed under the authority of the hostile army’, and ‘the occupation extends only to the territory where such authority has been established and can be exercised.’ It also says that ‘[The occupying power] must safeguard the capital of these properties [like public buildings , real estate, and other land], and administer them in accordance with the rules of usufruct.’ It seems clear that Israel is in no such position regarding the Gaza Strip, as the IDF doesn’t control any part of Gaza anymore. Israel doesn’t administer any property belonging to Gazans nor any means of transportation. The Hague convention also implies that occupation is a condition applying between states. When the Israeli army left Gaza, an unclear legal situation was created, as Gaza doesn’t belong to any sovereign state. Moreover, some argue that, if Israel would still occupy Gaza, this would mean it has the right or even the duty to maintain law and order there. 
Hamas won the 2006 Palestinian legislative elections. However, when a Hamas-controlled government was formed, continuing to refuse to recognise Israel, renounce violence and agree to honour agreements previously made by the PLO, Israel, the United States, Canada, and the European Union froze all funds to the Hamas-controlled government. They view Hamas as a terrorist organization.
In December 2006, news reports indicated that a number of Palestinians were leaving the Gaza Strip, due to political disorder and economic stagnation there.
In January 2007, fighting continued between Hamas and Fatah, without any progress towards resolution or reconciliation. The worst clashes occurred in the northern Gaza Strip, where Gen. Muhammed Gharib, a senior commander of the Fatah-dominated Preventative Security Force, was killed when a rocket hit his home. Gharib’s two daughters and two bodyguards were also killed in the attack, which was carried out by Hamas gunmen.
At the end of January 2007, it appeared that a newly-negotiated truce between Fatah and Hamas was starting to take hold . However, after a few days, new fighting broke out. Fatah fighters stormed a Hamas-affiliated university in the Gaza Strip. Officers from Abbas’ presidential guard battled Hamas gunmen guarding the Hamas-led Interior Ministry.
In May 2007, the deal between Hamas and Fatah appeared to be weaker, as new fighting broke out between the factions. This was considered a major setback. Interior Minister Hani Qawasmi, who had been considered a moderate civil servant acceptable to both factions, resigned due to what he termed harmful behavior by both factions.
Fighting spread in the Gaza Strip with both factions attacking vehicles and facilities of the other side. In response to constant attacks by rocket fire from the Gaza Strip, Israel launched an air strike which destroyed a building used by Hamas. Some Palestinians said the violence could bring the end of the Fatah-Hamas coalition government, and possibly the end of the Palestinian authority.
Hamas spokeman Moussa Abu Marzouk placed the blame for the worsening situation in the Strip upon Israel, stating that the constant pressure of economic sanctions upon Gaza resulted in the “real explosion”. Expressions of concerns were received from many Arab leaders, with many offering to try to help by doing some diplomatic work between the two factions. One journalist wrote an eyewitness account stating:
Today I have seen people shot before my eyes, I heard the screams of terrified women and children in a burning building, and I argued with gunmen who wanted to take over my home. I have seen a lot in my years as a journalist in Gaza, but this is the worst it’s been.
Hamas control (2007-Present)
In June 2007, the Palestinian Civil War between Hamas (Islamic Resistance Movement) and Fatah (Palestine Liberation Movement) intensified. Hamas routed Fatah, and by 14 June 2007, the Gaza Strip was completely overrun by Hamas, which now effectively controlled the Gaza Strip and proclaimed itself to be the legitimate government of the Palestinian Authority. PA Chairman Mahmoud Abbas responded by declaring a state of emergency, dissolving the unity government and forming a new government without Hamas participation. PA security forces in the West Bank arrested a number of Hamas members and closed some Hamas offices.
After Hamas’ victory in June it started ousting Fatah-linked officials from positions of power and authority in the Strip (such as government positions, security services, universities, newspapers etc) and strove to obtain a monopoly of fire power by progressively removing guns from the hands of peripheral militias, clans, and criminal groups, and gaining control of smuggling tunnels. Under Hamas rule, newspapers have been closed down and journalists have been harassed. Fatah demonstrations have been forbidden or suppressed, as in the case of a large demonstration on the anniversary of Yasser Arafat’s death, which was suppressed violently by Hamas security forces, killing 7 and wounding 130. 
Christians are being threatened and assaulted in the Gaza Strip. The owner of a Christian bookshop was abducted and murdered,, and on February 15, 2008, the Christian Youth Organization’s library in Gaza City was bombed. Hamas condemns these attacks.
Since the Hamas takeover of the Gaza Strip, the EU Border Monitors at the Rafah Crossing have not been able to perform their functions under the Agreement, citing security concerns, resulting in the Rafah Crossing being mostly closed. The only land access into the Strip to Israel is via the Erez and Karni crossings. Meanwhile Hamas continued smuggling in large quantities of explosives and arms from Egypt through tunnels, as Israeli and Egyptian security reports claim. Egyptian security forces uncovered 60 tunnels in 2007. 
While clamping down on lawlessness in the Strip, Hamas has made no effort to control the continued firing of Qassam rockets from the Strip across the border into Israel, targeted at Israeli civilians. According to Israel, since the Hamas takeover of the Gaza Strip until the end of January 2008, 697 rockets and 822 mortar bombs have been fired at Israeli towns.  In response, Israel targeted Qassam launchers and military targets and on September 19, 2007, declared the Gaza Strip a hostile entity, to make it possible to cut fuel and electricity supplies. In January 2008 the situation escalated and Israel curtailed travel from Gaza and entry of goods, and decided to cut fuel supplies to the Strip on January 19, resulting in power shortages. This brought charges that Israel was inflicting collective punishment on the Gaza population, leading to international condemnation. Israel countered that Gaza had enough food and energy suplies for weeks
Abbas’ government has won widespread international support. Egypt, Jordan, and Saudi Arabia said in late June 2007 that the West Bank-based Cabinet formed by Abbas was the sole legitimate Palestinian government, and Egypt moved its embassy from Gaza to the West Bank.. The Hamas government in the Gaza Strip faces international diplomatic and economic isolation.
However, both Saudi Arabia and Egypt support reconciliation and the forming of a new unity government, and press Abbas to start serious talks with Hamas. Abbas has always conditioned this on Hamas ceding control of the Gaza Strip to the Palestinian Authority. Hamas is supported by Syria and Iran, and is believed to have brought in large sums of money from Iran. Hamas fighters are also believed to have received training in Iran. Hamas has been invited to and has visited a number of countries, including Russia, and in the USA and EU countries, opposition parties and politicians have called for a dialog with Hamas and an end to the economic sanctions.
On January 23, 2008, after months of preparation during which the steel reinforcement of the border barrier was weakened, Hamas destroyed several parts of the wall dividing Gaza and Egypt in the town of Rafah. Hundreds of thousands of Gazans crossed the border into Egypt seeking food and supplies. Egyptian President Hosni Mubarak ordered his troops to allow the Palestinians in, due to the crisis, but to verify that they did not bring weapons back. Egypt arrested and later released several armed Hamas militants in the Sinai who presumably wanted to infiltrate into Israel. At the same time, Israel increased its state of alert along the length of the Israel-Egypt Sinai border, and warned its citizens to leave Sinai “without delay”. The EU Border Monitors have indicated their readiness to return to monitor the border, should Hamas guarantee their safety; while the Palestinian Authority has demanded that Egypt deal only with the Authority in negotiations relating to borders. Israel has eased up some influx of goods and medical supplies to the strip, but it has curtailed electricity by 5% in one of its ten lines, while Hamas and Egypt have shored up some of the gaping holes between the two areas. The first attempts by Egypt to reclose the border were met by violent clashes with Gaza gunmen, but after 12 days the borders were sealed again. In mid-February there had still been no agreement reached between the parties on conditions for reopening the Rafah crossing. In February 2008 an Haaretz poll indicated that 64% of Israelis favour their government holding direct talks with Hamas in Gaza about a cease-fire and to secure the release of Gilad Shalit, an Israeli soldier who was abducted in a cross border raid by Palestinian militants on 25 June 2006 and has been held hostage since.
In February 2008, Israeli-Palestinian fighting intensified with rockets launched at Israeli cities and Israel attacking Palestinian militants. An increase in rocket attacks lead to a heavy Israeli military action on March 1, resulting in over 100 Palestinians being killed according to BBC News, as well as 2 Israeli soldiers. Israeli human rights group B’Tselem estimated that 54 of those killed were not involved in hostilities, and 25 were minors.  . Current ongoing status is held between Hamas and Israel. Some Jewish groups are also trying to wrestle sovereignity away from Hamas, such as Baruch Marzel and Tzvi Fishman.