Muslim pilgrims tripped over baggage as they rushed to cast stones at pillars representing the devil, causing the latest deadly stampede to mar the annual hajj.

At least 345 people were killed in Thursday's tragedy, underlining the difficulty in managing one of the biggest religious events in the world, which this year drew more than 2.5 million pilgrims.

In the stoning ritual, all pilgrims must pelt a series of three pillars called al-Jamarat, which represent the devil, to purge themselves of sin.

The site in a desert plain of Mina outside Mecca is a notorious bottleneck in the weeklong pilgrimage — the scene of deadly incidents in seven of the past 17 years, including a stampede in 1990 that killed 1,426 people and another in February 2004 that killed 244.

Thousands of pilgrims were rushing to complete the last of the three days of the stoning ritual before sunset, when some of them stumbled over baggage, causing a large pileup, Interior Ministry spokesman Maj. Gen. Mansour al-Turki said.

Many pilgrims carry their belongings — tents, clothes or bags of food — as they move between the various stages of the hajj, which ends Friday.

"This was fate destined by God," al-Turki said. "Some of the pilgrims were undisciplined and hasty to finish the ritual as soon as possible."

Most of the victims were from South Asia, state-run Saudi television Al-Ekhbariyah reported. The Health Ministry said nearly 290 people were injured.

Bodies were lined up on the pavement nearby, covered with white sheets, and emergency workers rushed the injured away on stretchers. Police cleared part of the site, but thousands of pilgrims continued the stoning ritual nearby.

"I heard screaming and ... saw people jumping over each other," said Suad Abu Hamada, an Egyptian pilgrim who was nearby when the stampede broke out. "Police starting pulling out bodies. The bodies were piled up. I couldn't count them, they were too many."

It was the second accident to tarnish this year's hajj, following the Jan. 5 collapse of a building being used as a pilgrims' hotel that killed 76 people in Mecca.

After the 2004 stampede, Saudi authorities widened ramps leading to the platform where the three pillars are located and created more emergency exits to accommodate the crowds.

The small, round pillars were replaced with 85-foot long walls to allow more people to stone them at once without jostling each other. The walls extend down through the bridge and protrude underneath, so pilgrims below can also carry out the stoning without going above.

Thursday's stampede occurred below the platform, near one of the entrance ramps.

"This should not happen every year. It should be stopped, it's a scandal. There must be a way to organize this better," said Anwar Sadiqi, a Pakistani pilgrim.

Ensuring a smooth pilgrimage is a key concern for Saudi Arabia's royal family, which bolsters its legitimacy by touting its role as the "custodian of the holy cities" — Mecca and Medina, where Islam's 7th century prophet Muhammad was born and lived.

Crown Prince Sultan bin Abdel Aziz told reporters the state had "spared no effort" to prevent such disasters but added, "it cannot stop what God has preordained. It is impossible."

"We feel pain and sorrow for them and for their families and we send our condolences," the prince said on Al-Ekhbariya television.

The annual hajj is a complex balance of safety with Islam's requirements that every able-bodied Muslim should perform the hajj at least once. Saudi Arabia sets a quota of participants, allowing every nation to send 1,000 pilgrims for every 1 million in population.

Traditionally, the stoning is carried out from midday to sunset. Shiite Muslim clerics have issued fatwas, or religious edicts, allowing pilgrims to do the stoning in the morning, and some Sunni clerics have followed suit in an attempt to space out the crowds.

But some clerics following Saudi Arabia's strict Wahhabi interpretation of Islam advise the faithful to stick to the midday start.

About 60,000 Saudi troops have been patrolling the Mina plain since the stoning ritual began on Tuesday to direct pilgrims. Helicopters fly overhead, and authorities monitor the pilgrims from a control room through closed-circuit television.

But some complained the police did little to help the flow of traffic.

"They look indifferent. They don't carry out their duties seriously," Iftikhar Hussein, an Iraqi pilgrim, said. "This looks like a garage rather than a holy site."

Signs giving directions are few, and pilgrims often ignore regulations, entering the platform via ramps meant for exiting and vice versa. Peddlers selling food and souvenirs also mingle among the pilgrims, jamming traffic.

Saudi Arabia has announced plans for further changes to the site in coming years that it says would allow some 500,000 pilgrims an hour to carry out the stoning.