The 365 Crete earthquake struck the region and destroyed all the five major cities of the Pentapolis. Ptolemais survived the tragedy in relatively good condition. It served as capital of Cyrenaica until 428. The city was destroyed by the Libyans in 411. During the reign of Justinian I the city was rebuilt, but it never regained its powers and was again destroyed during the Muslim conquest of the Maghreb in the 7th century.