 In 614, the Sasanid Persians conquered the area and destroyed the castle, leaving only ruins; but in 637, the area came under the control of the Arab Muslims and the building was reconstructed as a roofed mosque.The Muslims permitted the building of two small synagogues at the site.During the 10th century, an entrance was pierced through the north-eastern wall, some way above the external ground level, and steps from the north and from the east were built up to it (one set of steps for entering, the other for leaving).