MADRID (AP) -- Spanish, Norwegian, and British oil companies were evacuating workers from Algerian energy facilities Thursday following the hostage-taking by Islamic militants in the Sahara desert and Algeria's attempt to free them.

Spain's Compania Espanola de Petroleos SA said it moved workers from two Algerian facilities to the center of the country as a precautionary measure and that its Algeria operations were functioning normally. Spain gets nearly half its natural gas from Algeria.

BP (BP 1.36%) said plans are under way to bring some non-essential workers out of Algeria.

Helge Lund, the CEO of Norwegian energy company Statoil (EQNR 1.53%), said about 40 non-essential staff would be flown back to Norway.

The hostages were taken Wednesday by militants linked to Mali's rebel Islamists at a remote Sahara natural gas plant. The site is operated by BP, Statoil, and the Algerian state oil company Sonatrach. A Japanese company, JGC (JGCCY 5.02%), provides services for the facility.