According to local legend,[REF] the Prophet Muhammad was associated with the mosque's planning and construction around 630 AD (6 AH), though there is no evidence to support this [REF].
Much restoration was done in 1130 by the Isma`ili Queen Arwa ibn Ahmad.