 In addition to being a prayer house, the dome was used as a treasury for the local Muslim community.When the Crusaders invaded the Levant in 1099, they identified the dome as the spot where Saint James was martyred, and transformed the building into a chapel dedicated to him within the Templum Domini.In 1187, the building was returned to Muslim use after Saladin captured Jerusalem from the Crusaders.