The first mosque on the site was built around the 13th century, but the current structure dates from 1907