On Thursday, at least 36 people were killed and 16 injured after the floor covering a stepwell outside a Hindu temple collapsed, according to local officials.

The incident occurred at Beleshwar Mahadev Jhulelal Temple in Patel Nagar, Madhya Pradesh, during Ram Navami, a Hindu festival. A stepwell is a well with stairs that can be used to descend to the water level, and this one, in particular, was covered with an iron mesh.

The state’s Chief Minister Shivraj Singh Chouhan said in a statement on Twitter that he has been in touch with the federal government while monitoring the rescue operation.

According to Time magazine, nearly 140 rescuers, including state and national disaster response teams along with army personnel, pumped out the water from the well before using ropes and ladders to pull bodies up.

Only a narrow path could be used to rescue individuals as half of the well was covered in iron mesh, elevating the risk of debris falling in, as seen in videos online.

One witness, Prakash Patel, told The New York Times that he was at the temple when he heard cries for help. He saw people clinging to the iron mesh. “Many of those who died were women and children,” he said.

The rescue operation lasted almost an entire day as the injured were taken to the hospital.

“The stepwell was covered, but the slab covering it collapsed because of the crowd and extra load on it,” Chouhan said. He has ordered an investigation into the incident.

Meanwhile, Ilayaraja T, a local government official, told Reuters that a major cause of death could be drowning, since the well was full of water and 60 feet deep.

Prime Minister Narendra Modi said he was “extremely pained” by the incident and gave his prayers to the families of those affected. He later announced that an ex-gratia worth Rs. 200,000, or roughly $2,400, would be dispersed to the next of kin of the deceased, while the injured would be offered Rs. 50,000, or roughly $600.