Dozens of others were hurt in Karachi as they jumped out of windows in the four-storey building to escape the blaze that began Tuesday evening in a bid to save their lives.
Shouting and sobbing relatives of trapped workers, desperate to get inside the factory, scuffled with police overnight as rescuers battled to work through the night, an AFP photographer said.
Karachi fire chief Ehtesham Salim said dozens of bodies were found in the factory's basement.
"We found dozens of people dead in a large room of the factory's basement. It was totally burnt and parts of it were smouldering, which we put out before taking the bodies to hospitals."
Abdus Salam, a doctor at Karachi's Civil Hospital, said bodies were badly burnt and that at least 65 other workers suffered broken bones after jumping out of windows to escape the flames.
Salim called the factory dangerous, saying it had been flimsily built, lacked emergency exits and had developed cracks in the walls, which was also putting rescue workers at risk.
"It was packed like a box with little room left for ventilation. There were no emergency exits," Salim said.
"We found people who died of suffocation caused by the highly toxic smoke. They died first and then their bodies were burned by the raging fire," he said.
According to workers, the factory produced underwear and plastic utensils.
Salim said the disaster was Karachi's "biggest fire in terms of deaths in decades".
In January 2009, 40 people were killed, more than half of them children, when a fire engulfed dozens of wooden homes in Karachi's impoverished Baldia neighbourhood.
The garment trade is vital to Pakistan's shaky economy.
According to central bank data, the textiles industry contributed 7.4 percent to Pakistan's GDP in 2011 and employed 38 percent of the manufacturing sector workforce. It accounted for 55.6 percent of total exports.
Noman Ahmed, from the NED University of Engineering and Technology in Karachi, said few industries and businesses implement the law on safety and fire exits, finding it easy to get away with it because of lack of effective monitoring.
"Most of our shopping centres and markets too have no safety mechanism, which the authorities should review seriously, otherwise it could cause graver tragedies in future," he said.
Mohammad Saleem, 32, who broke a leg after jumping out of the second floor, said he and his colleagues were hard at work late Tuesday.
"It was terrible, suddenly the entire floor filled with fire and smoke and the heat was so intense that we rushed towards the windows, broke its steel grille and glass and jumped out," Saleem told AFP.
"It was extremely painful. I saw many people jumping out of windows and crying in pain for help," he said.
Around 150 employees were working at the time in one of the factory's three round-the-clock shifts, Saleem said.
Officials said the cause of the fire was unknown but Rauf Siddiqi, the industry minister for the southern province of Sindh of which Karachi is the capital, said the owner was under investigation for negligence.
"We have ordered an inquiry into how the fire erupted and why proper emergency exits were not provided at the factory so that the workers could escape," Siddiqi said.
In Lahore, flames also trapped dozens of workers in a shoe-making factory, killing 21 and injuring 14 others, local officials and medics said.
Tariq Zaman, a government official, blamed the blaze on a faulty generator.