At least 107 people died when a massive construction crane crashed into Mecca’s Grand Mosque, with scores more injured, Saudi authorities said, days before the annual Hajj pilgrimage.

The civil defence agency said on Twitter that emergency teams were sent to the scene after a “crane fell at the Grand Mosque’’, one of Islam’s most revered sites.

That came about an hour after it tweeted that Mecca was “witnessing medium to heavy rains’’, and pictures on social media showed lightning.

Ahmed bin Mohammad al-Mansoori, spokesman for the two holy mosques, was quoted by the official Saudi Press Agency as saying part of a crane collapsed at 5:10 pm (local time) “as a result of strong winds and heavy rains’’.

Abdel Aziz Naqoor, who said he works at the mosque, told AFP he saw the crane fall after being hit by the storm.

“If it weren’t for Al-Tawaf bridge, the injuries and deaths would have been worse,” he said, referring to a covered walkway that surrounds the holy Kaaba, which broke the crane’s fall.

The Kaaba is a massive cube-shaped structure at the centre of the mosque towards which Muslims worldwide pray and which has a major role in the hajj.

Pictures of the incident on Twitter showed bloodied bodies strewn across a courtyard where the top part of the crane, which appeared to have bent or snapped, had crashed into the building.

A video on YouTube showed people screaming and rushing around right after a massive crash was heard and as fog engulfed the city.

The incident occurred as hundreds of thousands of Muslims from all over the world gather for the annual hajj pilgrimage expected to begin on September 21.

The Grand Mosque is usually at its most crowded on Fridays, the Muslim weekly day of prayer.

Many faithful would have been gathered there ahead of evening maghrib prayers, which occurred about an hour after the tragedy.

The governor of Mecca region, Prince Khaled al-Faisal, has ordered an investigation into the incident and was heading to the mosque, the official @makkahregion account on Twitter said.

Irfan al-Alawi, co-founder of the Mecca-based Islamic Heritage Research Foundation, compared the carnage to that caused by a bomb.

He suggested authorities were negligent by having a series of cranes overlooking the mosque.

“They do not care about the heritage, and they do not care about health and safety,” he told AFP.