A freed British hostage has told Sky News how he fled the Algerian gas complex through a fence in a 'Great Escape' style scene.
BP employee Alan Wright spent days hidden in a pitch-black room with colleagues at the In Amenas plant after hearing gunfire.
Eventually, the 30 or so workers in the building decided to cut through a perimeter fence and make a break for it.
He said: "It was like the Great Escape. We all climbed through the fence and ran into the desert as gunfire chattered behind us as the fighting went on."
But he said feared he had made the "biggest mistake" of his life when the troops who intercepted them in the desert split them into ex-pats and locals - and he assumed they had fallen into the hands of the terrorists.
"You just think 'that's it'. If you’d been captured there was pretty much no escape from them, and you know it’s going to take a miracle to get you out."
The ordeal began on Wednesday morning, when he and colleagues locked themselves in their office after hearing gunshots.
The 37-year-old health and safety adviser, from Portsoy, Scotland, told Sky's James Matthew's that a terrorist attempted to entice the workers out of the room, with a friendly greeting.
"At around about 9.30am we heard … a very friendly national voice say 'good morning' in Arabic, and we’re certain that was the terrorists coming in and trying to lull people into coming out friendly.
"That was the first moment that you thought 'we’re in big trouble here'."
For the next nine hours they could hear sporadic gunfire, which stopped at about 11pm.
When the sound of loud gunfire resumed, he feared the worst.
"We just assumed we were surrounded, and (the terrorists) were waiting, just going round and gathering people up."
Along with three other workers, he decided to move to another room where they closed the blinds, leaving them in total darkness for three days.
Eventually, Algerian employees in another room convinced them that no-one was coming to get them, and they cut the fence and made their daring break for it.
Mr Wright disguised himself as a local, and made his escape.
He said it was important not to run and attract attention to themselves.
"You know these guys are behind you and if they see you, you don't know if they're going to be shooting at you, you just don't know where everybody is.
"There was a mixture of relief, but you've no idea of what is out there.
"We got about a kilometre into the desert and you can see the military point with eight or nine military personnel with guns pointing into our spot but also that they had identified us and were making tracks to come our way.
"Then you think 'Is it the terrorists or is it the gendarmes?'"
"And for 20 minutes you're still not sure - we're down on your hands and knees with our hands up."
When the group was split into Algerians and ex-pats, Mr Wright thought they had walked into the hands of the terrorists.
He said: "You're thinking you've just made the biggest mistake of your life.
"That was a horrible, horrible thing, that you have escaped then into the hands of the terrorists, or so we thought.
"You fear the worst, you can't put into words how bad you feel, it's something you never want to go through again."