Three women managed to dash out of a burning room and groped their way down three floors in darkness but found that the main steel door in the building in downtown Butuan city was locked, police investigator Jonathan Basil said.
Bystanders used a hydraulic car jack to pry open the gate and pulled the three screaming women out from the burning lobby, Basil said.
"The women kept on pounding the hot steel gate while yelling for help," Basil told The Associated Press by telephone, adding that the employee who kept the door key perished in the room upstairs.
Mylene Tulo, one of three who escaped, said she woke up as the fire spread rapidly in the third-floor room where they slept. She managed to dash out with two colleagues. All three sustained minor burns on their arms.
"We wanted to rouse others from sleep, but the fire was already too strong," a stunned Tulo said.
Investigators were trying to determine what sparked the fire, which broke out at 3:55 a.m. and raged for five hours, city police chief Pedro Obaldo said.
Many stores in the Philippines allow their employees to sleep over, especially those from faraway homes.
Relatives and friends failed to identify any of the 17 badly burned bodies at a funeral home and were asked to bring dental records or anything that could help authorities establish the identities of the dead.
A lack of firefighting equipment and personnel coupled with safety violations has resulted in major fire disasters in the Philippines, especially in shantytowns. Butuan is a city of more than 300,000 about 790 kilometers (500 miles) southeast of Manila.