The Crusaders used the mosque as a palace.