Gaza was under Israeli control until 2005. The Agreement on Movement and Access was made between Israel and the Palestinian Authority as part of Israel's unilateral withdrawal from Gaza. That agreement collapsed in 2006 when Hamas took power. The PA had fled Gaza and were no longer able to uphold their side of the agreement; Hamas did not recognise the agreement and were unwilling to negotiate with the PA, Egypt or Israel on border security arrangements.