A militant group claimed responsibility for the attack, saying it was in revenge for Algeria's support of France's operation against Malian rebels with ties to al-Qaida.
The complex is operated by energy company BP, Norwegian company Statoil and the Algerian state oil company, Sonatrach.
A spokesman for Statoil says five employees —four Norwegians and a Canadian — are safe at an Algerian military camp and two of them have suffered minor injuries.
The militants said they were holding 41 foreigners from the energy complex, including seven Americans.
A Foreign Affairs spokeswoman says the department is monitoring the situation and does not believe any Canadians or dual-nationals are among the hostages.
Algerian authorities say security forces have surrounded the area and cornered the terrorists, who are in one wing of the complex's living quarters.
Algeria had long warned against military intervention against the rebels in northern Mali, fearing the violence could spill over its own long and porous border.
_ With files from The Associated Press.Suggest a correction