At least 22 pilgrims were killed and dozens were injured Tuesday in a stampede at a religious festival in the southern Indian state of Andhra Pradesh, according to local officials. The incident occurred in the town of Rajahmundry as thousands gathered to take a holy dip in the Godavari River on the first day of the annual Pushkaralu festival.

The stampede was a result of some pilgrims trying to retrieve their footwear that fell into the river, a police official said, according to the Associated Press. Some bodies of the pilgrims were taken to a government hospital, the Hindu reported, adding that police are yet to determine the identitiesof the deceased. 

A state administrator reportedly said that about 34 of the injured were rushed to a local hospital. Because of the huge crowds on the roads leading up to the accident site , ambulances and paramedics could not attend to the injured people on time, according to reports.

The incident occurred a few hours after Andhra Pradesh Chief Minister Chandrababu Naidu took a dip in the river to mark the beginning of the 12-day festival.

Following the stampede, Naidu reportedly visited those injured and announced a compensation of 1 million rupees ($15,753) to the families of the deceased. "We will probe how the incident occurred even after taking all the precautions and action will be taken," Naidu said, according to Hindustan Times.

Indian Prime Minister Narendra Modi offered condolences on Twitter to the families of the deceased.

Deadly stampedes are quite common during Indian religious festivals where people gather in large numbers in relatively small areas without the safety of crowd control measures. An estimated 24 million people are reportedly expected to attend the Pushkaralu festival, which is dedicated to worshipping rivers in the two states of Andhra Pradesh and Telangana.