Theoderic V was King of Spain from 788 to 803, and nominal Western Roman Emperor until 800. The son and successor of Theoderic IV, he came to power during a period of civil strife when the power of Spain was at its lowest for over a hundred years. By 795 he had managed to establish his rule over the whole kingdom, but his armies were left weakened and unable to withstand the emerging empire of Charlemagne.
In 799 he engaged the main Frankish army in battle in Gascony, with inconclusive results. However, at the same time, Charlemagne himself took an elite force of men on a daring raid south of the Pyrenees, and captured Theoderic's's capital of Barcelona by stealth and surprise. With the city garrison away campaigning in the north, Charlemagne was able to plunder the city and escape before news of the raid even reached Theoderic.
On Christmas Day, 800, Charlemagne took the plundered imperial regalia to Rome and had himself crowned Holy Roman Emperor by the Pope. Theoderic and his successors were thereby forced to abandon the title of emperor.
Theoderic V died in 803. He was succeeded as King by his brother, Witiges.