The decline of the Roman imperial power in the 5th century led to invasions of Hispania Baetica by Germanic peoples and by the Byzantine Empire. The southern Mediterranean coast was part of Visigothic Spain from the fifth century until the Muslim Arab conquest of Hispania (711–718) The city, then known as Mālaqa (مالقة), was encircled by defensive walls. In 1026 it became the capital of the Taifa of Málaga, an independent Muslim kingdom ruled by the Hammudid dynasty in the Caliphate of Córdoba, which was conquered by the Nasrid Kingdom of Granada.