As was common in those days the mosque was not only a place of prayer,but parts of it also served as a hospital and educational institution.