Australian Michael Matthews won the 21st stage of the race around the capital's city centre in a bunch sprint ahead of American Tyler Farrar and German Nikias Arndt.Horner finished 47th but maintained his 37 second advantage over Italian Vincenzo Nibali with Spain's Alejandro Valverde taking third.
"I knew how hard it was going to be for this team to win the Tour of Spain," Horner told a press conference on Saturday.
"I have faced younger and great riders like Nibali, Valverde and Joaquim Rodriguez. They have had a great tour so for me it is a legendary moment that may not be repeated.
"I know I am also the first North American to win the Tour of Spain and this makes me very proud of my work and above all that of my teammates."
Horner's bid for the title began in earnest on the third stage from Vigo to Villagarcia de Arosa, which he won to register his first ever stage victory in a grand tour and move ahead in the general classification.
He held the leader's red jersey for just a day as 2010 champion Nibali regained the lead on stage four, but he took the lead once more with another stage victory in the 10th stage from Torredelcampo to Guejar Sierra.
Nibali responded again and the Giro d'Italia winner seemed set for his second Tour of Spain title as he headed into the final week of the race with a 50 second lead.
However, Horner made significant strides into Nibali's advantage in the 16th and 18th stages before finally moving ahead of the Italian on the climb up the Alto Naranco in Oviedo in Friday's 19th stage.
And the RadioShack rider all but sealed his triumph when he moved away from Nibali in the final few kilometres of Saturday's dauting 12.2km climb to the top of the Alto de L'Angliru to open up his 37 second lead.
Nibali was content with his tour overall but accepted he may have underestimated Horner in the climb to Formigal on the 16th stage which handed the American a lifeline.
"I think I have competed well from the first stage. It was a very difficult tour but I think I honoured the red jersey," he said.
"It is possible that on Formigal I underestimated Horner and he gained some seconds there.
"I can't complain with how my year has gone. I won the Giro and I came here with the intention to win again in the Tour of Spain. I gave everything I had to wear the red jersey and defend it, but perhaps our strategy wasn't correct."
Horner also won the combined classification, whilst Valverde took the green jersey for the winner of the points classification.
Cofidis rider Nicholas Edet rounded off a generally successful tour for French riders as he was crowned king of the mountains and in their final grand tour before a revamp fronted by Formula One driver Fernando Alonso, Basque team Euskaltel-Euskadi won the team classification.