At least 107 people were killed when a crane crashed in Mecca's Grand Mosque on Friday, Saudi Arabia's Civil Defense head said, in an accident that came just weeks before Islam's annual hajj pilgrimage. At least 238 people were injured.

"All those who were wounded and the dead have been taken to hospital. There are no casualties left at the location," General Suleiman al-Amr, director general of the Civil Defense Authority, told al-Ikhbariya television. Strong wind and rains had uprooted trees and affected cranes in the area, he said.

Al Arabiya television earlier said the crane had fallen because of strong storms - western Saudi Arabia has been hit by strong sand storms in the last few days.

Pictures circulating on social media showed pilgrims in bloodied robes and masses of debris from a part of the crane that seemed to have crashed through a ceiling.

The Saudi government announced the opening of a commission of inquiry into the incident.

No identities have been officially released yet, but so far, no Israeli Arabs are said to be among the casualties.

Saudi authorities go to great lengths to prepare for the millions of Muslim who converge on Mecca to perform the sacred pilgrimage. Last year, it reduced the numbers permitted to perform hajj for safety reasons because of construction work to enlarge the Grand Mosque.

The pilgrimage, one of the largest religious gatherings in the world, has been prone to disasters in the past, mainly from stampedes as pilgrims rushed to complete rituals and return home. Hundreds of pilgrims died in such a stampede in 2006.

Saudi authorities have since lavished vast sums to expand the main hajj sites and improve Mecca's transportation system, in an effort to prevent more disasters.

Security services often ring Islam's sacred city with checkpoints and other measures to prevent people arriving for the pilgrimage without authorization.

Those procedures, aimed at reducing crowd pressure which can lead to stampedes, fires and other hazards, have been intensified in recent years as security threats grow throughout the Middle East.