Israel launched a three-week offensive against the Palestinian militant group Hamas in Gaza in response to the rocket attacks .