A crane collapsed on the main mosque in Saudi Arabia’s holy city of Mecca on Friday, killing at least 107 people and injuring 238, officials said, less than two weeks before the beginning of the annual hajj Islamic pilgrimage.

The crane crashed through a roof at Mecca’s Grand Mosque during a heavy rainstorm, leaving piles of debris, jagged rubble and bloodied victims on the marble floors. A Twitter message from Saudi Arabia’s Civil Defense Directorate said 238 people were injured.

Images on social media showed dazed survivors, and the injured and dead being dragged across blood-streaked floors.

A video posted on Twitter appeared to show the crane collapsing with a loud boom, followed by screams and confusion among the worshipers.

An Al Jazeera reporter in Mecca said the crane toppled onto the third floor of the Grand Mosque about 5:45 p.m. local time, when the mosque was packed with people awaiting the 6:30 p.m. prayer.

Dozens of ambulances raced to the site, and authorities closed off the area.

Lt. Gen. Suleiman al-Amr, head of the Civil Defense Directorate, said strong winds and rain uprooted trees and affected cranes in the area, Reuters news agency reported.

The mosque is among the largest in the world and surrounds Islam’s holiest site, the cube-shaped Kaaba, which is visited by millions of pilgrims and worshipers each year. The main annual pilgrimage, the hajj, takes place over five days, starting this year around Sept. 21. Muslims from around the world will flock to Mecca and other sites for observances related to the hajj.

Work has been underway to expand the mosque compound, with numerous cranes surrounding it.

Saudi authorities have invested heavily in recent years in efforts to improve safety during the hajj after a series of deadly mishaps. In one of the worst incidents, a stampede inside a pedestrian tunnel on the outskirts of Mecca in 1990 left more than 1,400 pilgrims dead.

The hajj is a religious duty that every Muslim is required to perform at least once, as long as the person is physically and financially able to make the pilgrimage. As Mecca, a city in western Saudi Arabia, has become more accessible to visitors, the hajj has grown increasingly crowded, leading to a number of dangerous incidents.

Among them have been stampedes, especially during the ritual of the stoning of the devil, a part of the pilgrimage that takes place in the city of Mina, just east of Mecca. A stampede during the rite in 2006 killed at least 346 pilgrims. Two years earlier, a similar stampede in Mina killed 251.

Read more:

How Saudi Arabia’s 79-year-old King Salman is shaking up the Middle East

Before he was king, Salman was the family disciplinarian

Today’s coverage from Post correspondents around the world