Four foreign hostages were freed during Thursday's raid by the Algerian military on the gas complex where Islamist gunmen were holding a group hostage, Algeria's official APS agency reported.