HYDERABAD, India -- Tens of thousands of pilgrims taking part in a Hindu religious bathing festival surged forward and triggered a massive stampede on a riverbank in southern India, leaving at least 27 dead and dozens injured in chaotic scenes in which rescuers struggled to respond quickly.

The stampede Tuesday along the Godavari River in Andhra Pradesh stampede was triggered by some pilgrims who were trying to retrieve their shoes, which had fallen off in the rush to the riverbank, police said.

Festival participants believe a bath in the river can rid them of their sins, and many believe it is more auspicious to bathe on the first day of the 12-day festival, called Pushkaralu.

"It was a frightening situation, with women and children crying for help," said pilgrim V. Satyanarayana, adding the mayhem lasted nearly 20 minutes. "The policemen on duty were helpless and it took more than an hour to bring the situation under control."

With the bodies of victims lying around, relatives wailed and cried for help. At least 34 people were hospitalized, said Andhra Pradesh's chief minister, Chandrababu Naidu.

Some pilgrims said ambulances took time to reach the site because the roads were overcrowded with people. Officials said that a small place like Rajahmundry, the disaster scene 450 kilometres east of Hyderabad, could not cope with the rush of hundreds of thousands of people, and that the situation became almost unmanageable.

Thousands of pilgrims, riding in buses, trains and other vehicles, started reaching the pilgrimage centre two days ahead of the start of the festival.

"There is a false belief that taking a holy dip in the river on the first day of the festival will be more auspicious," said Swamy Swaroopanand, a Hindu holy man. "It's the same as taking dip on any other day."

Indian Prime Minister Narendra Modi expressed grief over the tragedy, tweeting that he was "deeply pained" by it.

About 24 million people are expected to take part in the festival at varying points along the Godavari River, which flows through Andhra Pradesh and newly created Telangana state.

Deadly stampedes are fairly common during Indian religious festivals, where large crowds gather in small areas with few safety or crowd control measures.

In October 2013, a stampede in Madhya Pradesh state in central India killed more than 110 people, mostly women and children.