A train derailed near the capital of Pakistan on Sunday, killing more than 30 people, including women and children, and injuring nearly 100 others.

The train derailed while bound for Rawalpindi, about 40 minutes from Islamabad in northern Pakistan. 

Local television showed rescue teams extracting women, children and elderly passengers from damaged and overturned cars. Some of the injured were lying on the ground and crying for help while locals gave out water and food.

Expressing grief over the loss of life, Prime Minister Shehbaz Sharif prayed during a political gathering in Punjab for the souls of the departed and for the quick recovery of those injured.

1 DRIVER SERIOUSLY BURNED IN WISCONSIN FAIR DEMOLITION DERBY FIRE

People looking at the derailed train cars in Pakistan

Local residents examine damaged cars of a passenger train that derailed near Nawabshah, Pakistan, on Aug. 6, 2023. (AP Photo/Pervez Masih)

"We all pray, may Allah grant a place in heaven to those who passed away, and I wish quick recovery for the injured," he said.

WASHINGTON DECK COLLAPSE NORTH OF SEATTLE LEAVES 8 SUMMER CAMP STAFFERS INJURED

Senior railway officer Mahmoodur Lakho, who is in charge of railways in the crash area, said rescue crews took injured passengers to the nearby People's Hospital in Nawabshah. The most seriously injured passengers were taken to distant hospitals in military helicopters for better treatment.

Mohsin Sayal, another senior railway officer, said train traffic was suspended on the main railway line as repair trains were dispatched to the scene. Alternative travel arrangements and medical care would be made available for the train's passengers, he said. 

Emergency response to deadly Pakistan train derailment

Rescue workers and army troops respond to a derailed train near Nawabshah, Pakistan, on Aug. 6, 2023. (AP Photo/Pervez Masih)

All trains in both directions were held at the nearest stations until the tracks could be cleared, and all departures were delayed.

CLICK HERE TO GET THE FOX NEWS APP

Minister for Railways Khawaja Saad Rafique said an investigation into the cause of the crash was underway. He raised the possibility of a mechanical fault or the result of sabotage.

The Associated Press contributed to this report.