That might be destabilizing in Sinai, where Egypt’s military fought for years against Islamic militants and at one point accused Hamas of backing them.