The Visigoths, who had sacked Rome in 410, came to Hispania as allies of Rome to fight the Vandals, Sueves and Alans. From their kingdom based at Toulouse they took more and more of the peninsula, and after the Franks defeated them at Vouillé in 507 they moved south. In the later 6th century Toledo became their capital.
Leovigild (Visigothic king who united Hispania) conquered the kingdom of the Sueves in the north-west in 585. The Visigoths were a small ruling minority among millions of Hispano-Romans, and they followed Arian Christianity, which the Catholic majority saw as heresy. In 589, at the Third Council of Toledo, Leovigild’s son Reccared (king who made the Visigoths Catholic) declared the kingdom Catholic.
Church and king worked closely together. Isidore of Seville (bishop and encyclopedist), bishop and scholar, wrote the Etymologies, an encyclopedia used across Europe for centuries. King Recceswinth (Visigothic king and lawgiver) issued a single law code for Goths and Romans alike around 654. Gold votive crowns found at Guarrazar, near Toledo, in 1858 show the wealth of the court.
Kings were elected by the nobles, and fights over the throne were frequent. In 711, during one such conflict, an army of Berbers and Arabs led by Tariq ibn Ziyad (commander who crossed into Hispania) crossed from North Africa and defeated King Roderic (last Visigothic king), who died in or soon after the battle. Within a few years most of the peninsula was under Muslim rule.