PHNOM PENH, Cambodia — Thousands of people stampeded during a festival in the Cambodian capital Monday night, leaving more than 330 dead and hundreds injured.

Some in the panicky crowd – who were celebrating the end of the rainy season on a sliver of land in a river – tried to flee over a bridge and were crushed underfoot or fell over its sides into the water. A witness who arrived shortly after the stampede described “bodies stacked on bodies” on the bridge as rescuers swarmed the area.

Ambulances raced back and forth between the river and the hospitals for several hours after the stampede. Calmette Hospital, the capital’s main medical facility, was filled to capacity with bodies as well as patients, some of whom had to be treated in hallways. Many of the injured appeared to be badly hurt, raising the prospect that the death toll could rise as local hospitals became overwhelmed.

Hours after the chaos, the dead and injured were still being taken away from the scene, while searchers looked for bodies of anyone who might have drowned. An Associated Press reporter saw one body floating in the river, and hundreds of shoes left behind on and around the bridge.

Prime Minister Hun Sen, in his third post-midnight live television broadcast, said that 339 people had been killed and 329 injured. He described the chaos as the biggest tragedy to strike his country since the communist rule of the Khmer Rouge, whose radical policies are blamed for the deaths of 1.7 million people during the 1970s.

He ordered an investigation into the cause of the stampede and declared Thursday would be a national day of mourning. Government ministries were ordered to fly the flag at half-staff.

Authorities had estimated that upward of 2 million people would descend on Phnom Penh for the three-day water festival, which marks the end of the rainy season and whose main attraction is traditional boat races along the river.

The last race ended early Monday evening, the last night of the holiday, and the panic started later on Koh Pich – Diamond Island – a long spit of land wedged in a fork in the river where a concert was being held. It was unclear how many people were on the island to celebrate the holiday, though the area appeared to be packed with people, as were the banks.

Soft drink vendor So Cheata said the trouble began when about 10 people fell unconscious in the press of the crowd. She said that set off a panic, which then turned into a stampede, with many people caught underfoot.

Seeking to escape the island, the crowd pushed onto a bridge.