The Visigothic Kingdom or Kingdom of the Visigoths (Latin: Regnum Visigothorum; Gothic: Gutþiuda Þiudinassus) was a kingdom that occupied what is now southwestern France and the Iberian Peninsula from the 5th to the 8th centuries. One of the Germanic successor states to the Western Roman Empire, it was originally created by the settlement of the Visigoths under King Wallia in the province of Aquitaine in southwest France by the Roman government and then extended by conquest over all of the Iberian Peninsula. The Kingdom maintained independence from the Eastern Roman or Byzantine Empire, the attempts of which to re-establish Roman authority in Iberia were only partially successful and short-lived.
Sometimes referred to as the regnum Tolosanum or Kingdom of Toulouse after its capital Toulouse in modern historiography, the kingdom lost much of its territory in Gaul to the Franks in the early 6th century, save the narrow coastal strip of Septimania, but the Visigoth control of Iberia was secured by the end of that century with the submission of the Suebi. The kingdom of the 6th and 7th centuries is sometimes called the regnum Toletanum after the new capital of Toledo.
The ethnic distinction between the indigenous Hispano-Roman population and the Visigoths had largely disappeared by this time (the Gothic language lost its last and probably already declining function as a church language when the Visigoths converted to Catholicism in 589). Liber Iudiciorum (completed in 654) abolished the old tradition of having different laws for Romans and for Visigoths. Most of the Visigothic Kingdom was conquered by Arab Umayyad troops from North Africa in 711 AD, with only the northern reaches of Spain remaining in Christian hands. These gave birth to the medieval Kingdom of Asturias when a local landlord called Pelayo, most likely of Gothic origin, was elected Princeps by the Astures.
The Visigoths and their early kings were Arians and came into conflict with the Catholic Church, but after they converted to Nicene Christianity, the Church exerted an enormous influence on secular affairs through the Councils of Toledo. The Visigoths also developed the highly influential law code known in Western Europe as the Liber Iudiciorum, which would become the basis for Spanish law throughout the Middle Ages.