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 (NYSE:BP) said plans are under way to bring some non-essential workers out of Algeria.

Helge Lund, the CEO of Norwegian energy company Statoil (NYSE:STO), 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 (NASDAQOTH:JGCCY), provides services for the facility.

The Motley Fool recommends Statoil (ADR). Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.