At least two people died, including the train driver, when a Karachi-bound passenger train collided with an oil tanker in Punjab's Sheikhupura district of Punjab on Monday night.
Rescue personnel said five people were also injured in the accident. Minister for Railways Khuwaja Saad Rafique confirmed the casualties.
Rafique said the oil tanker was stuck due to a broken axle on the railway crossing and could not move as the train approached.
"Three carriages near the engine had caught fire after the collision, but the fire did not affect the other carriages much," said Najam Khan, spokesperson for the Pakistan Railways.
Khan added that further help was also sought from Lahore and nearby cities.
Firefighting vehicles battled in to the wee hours to control the flames and had extinguished most of the flames.
DSP Khalid Gujjar said the accident happened as the railway crossing was ungated.
The injured were shifted to the district headquarters hospital for medical treatment.
The Shalimar Express was heading towards Karachi from Lahore and had dozens of passengers onboard.
Earlier this year, a train crushed two motorised rickshaws on an ungated crossing, killing seven schoolchildren in Punjab's Lodhran district.
Train accidents are common in Pakistan, which inherited thousands of kilometres of track and trains from former colonial power, Britain.
The railways have seen decades of decline due to corruption, mismanagement and lack of investment.