ISLAMABAD (Reuters) - A fire swept through a Pakistani train on Thursday, killing 73 people and injuring nearly 40 after a gas canister that passengers were using to cook breakfast exploded, the minister of railways said.

People gather at the place where a fire broke out in a passenger train and destroyed three carriages near the town of Rahim Yar Khan, Pakistan October 31, 2019. REUTERS/Stringer

The fire destroyed three of the train’s carriages near the town of Rahim Yar Khan in the south of Punjab province. It was on its way to Rawalpindi, near the capital, from the southern city of Karachi, with many people traveling to a religious gathering.

It was the worst disaster on Pakistan’s accident-plagued railway system in nearly 15 years.

“Two stoves blew up when people were cooking breakfast, the presence of kerosene with the passengers in the moving train further spread the fire,” Minister for Railways Sheikh Rashid Ahmed told Geo television.

Many of the dead were killed when they leapt from the moving train to escape the flames, he said.

People sneaking stoves onto trains to prepare meals on long journeys is a common problem, the minister said. Shortly before the fire broke out, the conductor had ordered some passengers to stop cooking but they had ignored him, Ahmed said.

But several survivors questioned whether the fire was sparked by a cooking accident, telling media they believed the cause was a short-circuit in the train’s electrical system.

Slideshow ( 10 images )

Television pictures showed fire and black smoke pouring from the train’s windows after it came to a stop on a stretch of line flanked by fields.

“People were jumping off, some of them were on fire,” a witness told Geo.

Some of the victims were burned beyond recognition, said the deputy commissioner of the district, Jameel Ahmad.

“We’ll have to carry out DNA tests,” Ahmad told Reuters.

Nearly 40 people were injured, many with serious burns, he said.

Many of the passengers were heading to a conference organized by the Tablighi Jamaat Sunni Muslim missionary movement, officials said.

Prime Minister Imran Khan said he was deeply saddened.

“I have ordered an immediate inquiry to be completed on an urgent basis,” Khan said in a post on Twitter.

Pakistan’s colonial-era railway network has fallen into disrepair in recent decades due to chronic under-investment and poor maintenance, and accidents are common.

About 130 people were killed in 2005 when a train rammed into another at a station in Sindh province, and a third train hit the wreckage.