At least 27 people have been killed and 34 others injured in a stampede during a Hindu religious bathing festival in southern India, a government official has said.

The stampede occurred in Rajahmundry in Andhra Pradesh state as tens of thousands of people pushed forward to bathe in the Godavari River during the Pushkaralu festival, said Arun Kumar, a state administrator.

An additional 34 people were admitted to a hospital with injuries, Kumar said.

The melee was triggered by some women pilgrims who were trying to retrieve their shoes, which had fallen off in the rush to the river bank, police said.

Some pilgrims said ambulances took time to reach the site because the roads were overcrowded with people.

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

Rajahmundry is 450km east of Hyderabad, the joint capital of Andhra Pradesh and newly created Telangana state. Nearly 24 million people are expected to take part in the 12-day festival along the Godavari River flowing through the two states.

Festival participants believe a bath in the river can rid them of their sins.

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.

Source: Agencies