It took more than a day, but the last of 96 miners forced into shelters by fire and smoke at a Saskatchewan potash mine were finally brought to the surface Thursday night.

"We've got everyone out of the mine," said company spokesman Bill Johnson. "Certainly they were hungry and ready to be up on surface."

He said the fire at Potash Corp. of Saskatchewan's Allan mine near Saskatoon started in the engine of an underground water truck on Wednesday afternoon.

Story continues below advertisement

Emergency workers spent the next eight hours putting out flames and clearing smoke while the miners waited in refuge stations and sealed-off passageways.

About half made it safely to the surface overnight, before a power outage stopped some underground fans in one area from clearing smoke. The outage prevented the others from leaving and also cut phone service to the shelters.

"Typically it doesn't take nearly this long to clear the smoke," Johnson said. "A mine is hundreds of miles of tunnels — if you don't have fans to push the air along, it takes longer for smoky air to dissipate.

"We have a pretty strict set of protocols when something like this happens, and sometimes it takes a little longer than you would like."

Ron St. Pierre, the local president with the United Steelworkers union, was working above ground as a hoist operator when the fire started.

He said a "stench gas" was released underground to let everyone underground know that they needed to get to safety. All workers have had safety training and participated in drills to prepare for such a scenario, he said.

The miners, spread across a vast network of tunnels, made it to refuge stations or used special curtains or "brattice" to seal themselves into dead-end sections. While the stations are stocked with food and water, those in sealed passageways had only the lunch pails they brought with them, said St. Pierre.

Story continues below advertisement

All had been below since their shift started at 7 a.m. Wednesday.

St. Pierre spoke with some workers after they were released, and said they were "grouchy and hungry."

There's not much to do but play cards or sleep, he said.

"It seems very frustrating and slow but that's what you have to do," St. Pierre said. "The company has gone very slowly and followed procedure to ensure nobody would be injured by breathing contaminated air."

There have been similar occurrences at other Saskatchewan mines in recent years.

In February, about 50 workers at the Agrium mine near Vanscoy spent a night in the facility's refuge station due to a fire.

Story continues below advertisement

In 2013, 318 miners raced to safety units after flames broke out at Mosaic's K2 potash mine near Esterhazy. They spent several hours underground until the smoke had cleared. Seven years earlier, a fire at the same facility trapped 72 workers in refuge stations for 30 hours.

Another fire in 2012 at PotashCorp's Rocanville mine in eastern Saskatchewan forced 20 miners to seek shelter. It took about 10 hours to put out the fire and several more hours for rescue crews to determine that it was safe for workers to leave.