What caliph reigned in the 7th and 8th century