ALLAHABAD, India — The pilgrims came, millions upon millions of them, in the greatest tide of humanity ever seen. Again and again, the vast crowds threatened to press too close, to trample the smallest. Then it happened.

As many as 30 people were killed Sunday in a stampede at the train station here as they rushed up steps leading to one of the platforms, the police said. The stampede came at the height of the Kumbh Mela, a Hindu religious festival that occurs once every 12 years by the banks of the Ganges and Yamuna Rivers.

“I can’t believe God punished us this way,” said Santos Singh, one of the pilgrims at the station. “My 15-year-old son got injured. I wish police were more responsive.”

About 30 bodies covered in white sheets were visible on the train platform on Sunday evening. Several appeared to be children.

Death and loss has long been associated with the pilgrimage at the Kumbh, which takes place in other locations according to a different cycle. Deadly stampedes occurred at the Allahabad pilgrimage in 1840, 1906, 1954 and 1986. And yet still the pilgrims come. Hindu lore says that when the moon and Jupiter align, the Ganges and Yamuna are joined by a mystical river, the Saraswati, bearing the divine nectar of immortality.

Those who bathe in the conjoined waters are cleansed of their sins and given blessings that extend through several generations, Hindus say. Pilgrims make the trip not just for themselves but for their children and grandchildren.

Another lure is the presence of thousands of mystics, whom Hindus revere as spiritually powerful. But the crowds around the great procession of naked mystics in the predawn hours on Sunday were frightening.

Finally, the mystics rushed toward the holy waters, some with spears, tridents and swords held high.

They plunged in, scattering marigolds and sacred ash. Other pilgrims surged forward, and the mystics had to fight their way back to shore.

Government officials estimated that 10 million pilgrims were encamped in Allahabad on Saturday night, with 20 million to 30 million expected to bathe by Monday.

If those figures are even close to being accurate, it is as if the entire population of Texas decided to visit an area the size of Savannah, Ga., all on the same weekend.

About 80 million pilgrims — roughly the population of Germany — are expected at some point in the Kumbh’s 55-day run. By comparison, 3.1 million people visited Mecca in Saudi Arabia during last year’s annual pilgrimage, the hajj. Each successive Kumbh breaks the record for the largest gathering in human history.

Many stay in a huge tent city built on riverbanks that were underwater as recently as October. Its inhabitants have access to drinking water, public toilets, good health care and consistent electricity — none of which India has been able to reliably deliver anywhere else.

The precautions and amenities are intended to prevent the stampedes and plagues that have so worried government officials. About 70,000 government employees provide security, sprinkle insecticide, sweep up excrement and spray bleach. But it was not enough to avert a tragedy on Sunday.

The stampede was set off by railway delays, shoddy infrastructure and overcrowding, several witnesses said. Train service was severely delayed during the early evening, they said, leaving more and more passengers stranded in the small station.

Prime Minister Manmohan Singh said he was shocked by the tragedy and promised to compensate the injured and the families of those killed.

A stampede seemed possible several times on Sunday as pilgrims jockeyed to be present at the one place and time where the gods are said to bestow their most precious gifts. One problem is that pilgrims often linger in the water and on the beach, preventing the next wave of people from entering. The police routinely charged onto the beach, blowing whistles and pushing people back with long bamboo poles to clear the way for more pilgrims. Again and again, young children seemed threatened by the surging crowd.

The intense jostling separated many families, and desperate searches took place all over the beach. Thousands of weeping children and older women ended up in tents for the lost. Loudspeakers announced names, hometowns and locations.

Devanti Devi, of Bihar, said her 70-year-old mother had been missing for three days. “She doesn’t have any money, and I don’t think she can hear the announcements,” Devi said. “I’m really worried.”

Madhusudhan Upadhaya, a tea seller from Hyderabad, said he had traveled for nearly two days with his wife and mother-in-law before arriving in Allahabad.

“I’ve come here for the blessing, which is best gotten here,” Upadhaya said. “But I don’t know if it will work. It’s not science. You can’t test this.”