Agila I was elected king in 549. The Visigoths were engaged in internal power struggles when the Byzantine Emperor Justinian I took the opportunity to try to conquer Baetica. After many battles and the defeat of several of their leaders, the Visigoths eventually managed to conquer every corner of the region. In 572, Leuvigild, the designee to reign, obtained the kingdom after the death of his brother Liuva I. In 585, his son Hermenegild, after converting to Catholicism (in contradistinction to the Arianism of former kings) rebelled against his father and proclaimed himself king in the city. Legend tells that in order to force his way, Leuvigild changed the course of the Guadalquivir River, hindering the passage of the inhabitants and causing a drought. The old channel passed by the present-day Alameda de Hercules. In 586, Leuvigild's other son Reccared I acceded to the throne and with Spali itself went on to enjoy a time of great prosperity. After the Muslim invasion of Spain, the city became, next to Cordoba, one of the most important in Western Europe. Christianity In Visigothic times two Catholic prelates of Hispalis, Leander and Isidore, are notable; they were brothers and both were canonised as saints. Leander, in addition to his intensive labors in reforming the regular and the secular clergy, converted Hermenegild, viceroy of Baetica and son of King Leuvigild (an Arian adherent), to Catholicism. The Visigothic prince rebelled against his father and began an uprising supported by the Hispano-Roman nobility, upon the failure of which Hermenegild was executed in 585. After the death of Leuvigild in 586, Leander had a prominent role in the Third Council of Toledo in 589, where the new king Reccared I, Hermenegild's brother, converted to Catholicism along with all the Visigothic nobility. Isidore wrote a set of twenty encyclopaedic books known as the Etymologies that contained all the knowledge of the ancient Greco-Roman culture (medicine, music, astronomy, theology, etc.), which was of great influence throughout medieval Europe. Muslim al-Andalus The Muslim general Musa bin Nusayr commanded Tariq ibn Ziyad to invade Spain in the late spring of 711 with an army of 9,000 men. That summer, these forces fought a large army raised by the Visigothic king Roderic, who was killed at the Battle of Guadalete. When Tariq met little resistance as his divisions moved through the Visigothic kingdom, it is said that Musa was jealous that such