ALLAHABAD, India -- Anxious relatives searched for missing family members in northern India on Monday during one of the world's largest religious gatherings, unsure if their loved ones were caught in a stampede that killed 37 people or had simply gotten lost among the tens of millions of pilgrims.

People thronged to the main hospital in Allahabad to see if their relatives were among 37 dead and 39 people injured in Sunday evening's stampede at the city's train station. Tens of thousands of people were in the station waiting to board a train when railway officials announced a last-minute change in the platform, triggering the chaos.

An estimated 30 million Hindus took a dip Sunday at the Sangam -- the confluence of the Ganges, the Yamuna and the mythical Saraswati rivers -- as part of the 55-day Kumbh Mela, or Pitcher Festival. Sunday was one of the holiest days to bathe.

People missing at the Kumbh Mela is the stuff of legend in India and at least a dozen films have been made on the theme. On Sunday, like most other days, volunteers and officials used loudspeakers to give details of children and elderly people who were "found" on the river banks, having lost their families in the crowd.

It was unclear how many people were missing because of the stampede.

On Monday, state government officials and railway authorities told reporters that they had taken all precautions to prevent just such a tragedy.

Stampedes are common during religious festivities in India. During the Kumbh festival, platoons of policemen patrol the specially marked bathing areas to prevent crowding along the river banks in Allahabad.

For the past few weeks, and especially on festival days, authorities made constant announcements asking people to move in orderly lines to the bathing areas.

An official in the Uttar Pradesh state government in charge of the festival arrangements resigned Monday as the death toll mounted.

State minister Mohammed Azam Khan said he had "moral responsibility" for the stampede and submitted his resignation although the incident took place outside the Kumbh festival area.

Witnesses blamed police action for the stampede.

"We heard an announcement that our train is coming on platform No. 4 and when we started moving toward that platform through a footbridge, we were stopped. Then suddenly the police charged us with batons and the stampede started," passenger Shushanto Kumar Sen said.

"People started tumbling over one another and within no time I saw people, particularly women and children, being trampled over by others," Sen said.

Police denied they had used batons to control the crowd.

"It was simply a case of overcrowding. People were in a hurry to go back and there were not enough arrangements by the railway authorities," said Arun Kumar, a senior police officer.

Medical superintendent Dr. P. Padmakar of the main state-run hospital said 29 of the 37 people killed were women.

Railway Minister Pawan Kumar Bansal said an inquiry has been ordered into what led to the stampede. He said the railway station had huge crowds of people wishing to return home after prayers on the river banks.

"There were just too many people on the platforms," Bansal told reporters.

The crowds overran the station, and women, children and old people were pushed aside as people rushed toward the trains. Officials said train services were suspended after the stampede, leading to further crowding of the station.

Indian television stations showed large crowds pushing and jostling at the train station as policemen struggled to restore order.

"There was complete chaos. There was no doctor or ambulance for at least two hours after the accident," a witness told NDTV news channel.

Bansal said overcrowding at the station prevented medical teams from immediately reaching the injured.

Volunteers used stretchers to carry the injured to private vehicles which then ferried them to the hospital.

Bodies of the victims were being handed over to their families, Padmakar said. But 14 bodies were yet to be identified, he said.

The crowding at the station was just as bad Monday, with tens of thousands waiting to catch trains home.

"We just want to get out of here. But the trains are delayed," said Sunita Devi, a woman from neighbouring Bihar state.

Officials said railway authorities Monday began running special trains to enable people to return home and help reduce the crowds that were waiting for transport to leave Allahabad.

The auspicious bathing days of the Kumbh Mela are decided by the alignment of stars, and the most dramatic feature of the festival is the Naga sadhus -- ascetics with ash rubbed all over their bodies, wearing only marigold garlands -- leaping joyfully into the icy holy waters.

According to Hindu mythology, the Kumbh Mela celebrates the victory of gods over demons in a furious battle over nectar that would give them immortality. As one of the gods fled with a pitcher of the nectar across the skies, it spilled on four Indian towns: Allahabad, Nasik, Ujjain and Haridwar.

The Kumbh Mela is held four times every 12 years in those towns. Hindus believe that sins accumulated in past and current lives require them to continue the cycle of death and rebirth until they are cleansed. If they bathe at the Ganges on the most auspicious day of the festival, believers say they can rid themselves of their sins.