Factory fires have broken out in two major cities in Pakistan, killing 125 people and injuring dozens more, including some who had to break through barred windows and leap to the ground to escape the flames.

Workers recounted how their colleagues were trapped behind blocked exits, and firefighters said that one reason why the blazes were so deadly is that the buildings a shoe factory in the eastern city of Lahore and a garment factory in the southern port of Karachi lacked clear escape routes.

Such safety issues are common throughout Pakistan, where buildings also lack emergency equipment like alarms and sprinklers and municipal rules are rarely enforced.

The most deadly blaze came in Karachi, the country's economic heart, killing at least 100 people.

Firefighters could be seen pounding on the metal grates covering some of the windows and pulling out smoke-covered bodies. Many of the workers were injured when they jumped from the burning building, said a doctor at the Civil Hospital in Karachi, Karar Abbasi.

An injured factory worker, Mohammad Ilyas, speaking from the hospital, said he was working along with roughly 50 other men and women on one of the floors when suddenly a fireball came from the staircase.

"I jumped from my seat as did others and rushed toward the windows, but iron bars on the windows barred us from escaping. Some of us quickly took tools and machines to break the iron bars," he said. "That was how we managed to jump out of the windows down to the ground floor."

Fire fighters were still trying to subdue the deadly blaze that broke out on Tuesday evening, and senior police official Amjad Farooqi.

"There were no safety measures taken in the building design. There was no emergency exit. All the people got trapped," Farooqi said.

In Lahore, the fire swept through a four-story shoe factory and killed 25 people, some from burns and some from suffocation, said senior police officer Multan Khan. The factory was illegally set up in a residential part of the city.

It broke out when people in the building were trying to start their generator after the electricity went out. Sparks from the generator made contact with chemicals used to make the shoes, igniting the blaze. Pakistan faces widespread blackouts, and many people use generators to provide electricity for their houses or to run businesses.

One of the workers, Muhammad Shabbir, said he had been working at the factory for six months along with his cousin. He said all the chemicals and the generator were located in the garage, which was also the only way out of the building. When the fire ignited, there was no way out. Shabbir said he had just gone outside the factory when the fire started, but his cousin was severely burned and died at the hospital.

A firefighter at the scene, Numan Noor, said the reason most of the victims died was because the main escape route was blocked.

"The people went to the back side of the building but there was no access, so we had to make forceful entries and ... rescue the people," said Noor.

Pakistani Prime Minister Raja Pervaiz Ashraf in a statement expressed his shock and grief over the deaths in both cities.