Islamic militants , predominantly from Morocco and sympathetic to al-Qaeda , claimed responsibility for the attacks .