Israel and Egypt sealed their borders with the Gaza Strip in 2007 to prevent Hamas militants from getting weapons .