The Visigoths were a Germanic tribe that migrated from Eastern Europe into the Roman Empire in 376 to escape the Huns. They were granted lands in southern France by the emperor in exchange for expelling other tribes from Spain. The Visigoths established a kingdom in southern France until being defeated by the Franks in 507, after which they moved their capital to Toledo in Spain. Their kingdom expanded to control most of the Iberian Peninsula until it was overrun by Muslim invaders in 711 amid internal conflicts between kings and nobles.