Israel withdrew its settlers from Gaza in 2005 , but it still controls its coast , airspace and borders , and , until a ceasefire with Hamas was agreed in June , carried out regular military operations in the territory .