During the Six-Day War which was fought between Israel and a coalition of Arab states (primarily Egypt, Syria, and Jordan) from 5 to 10 June 1967, the IDF captured Gaza.
http://en.wikipedia.org/wiki/Six-Day_War
Israel held Gaza under occupation until 2005, when it withdrew troops and settlers...