Under Caliph Omar (579–644), the Arabs took the town and successfully resisted the attempts by the Byzantine Empire to recover it, especially in 739, 821, 921 and 968. The Abbasids used Alexandria, Damietta, Aden and Siraf as entry ports to India and the Tang Empire of China. Damietta was an important naval base during the Abbasid, Tulunid and Fatimid periods. This led to several attacks by the Byzantine Empire, most notably the sack and destruction of the city in May 853.