The previous oldest winner for one of the three grand tours the Vuelta, Tour de France and Giro d'Italia was Fermin Lambot, who won the 1922 Tour at the age of 36.
Besides being the oldest, Horner is also the first American to win the Vuelta.
"Many riders winning in their 20s and early 30s have small children, but mine are at the age where they can appreciate what dad is doing," Horner said. "When I get back, it will be quite the topic at home."
Horner, who will turn 42 next month, beat nearest challenger Nibali by finishing ahead of the Italian in each of the final three mountainous stages before Sunday's 110-kilometer (68-mile) ride from Leganes to Madrid.
Michael Matthews of Australia won the 21st and final stage in a sprint through Madrid's city center.
"We only had four other teammates to help with the sprint today, but everyone did their job 100 percent to help me get the win," Matthews said after his second stage win at this Vuelta for Orica Greenedge.
This edition of the Vuelta, the 68th, had been crafted to favor strong climbers with 13 of its 21 stages set in the mountains.
And Horner made the most of it, consistently pulling away with his high riding stance and a wry smile on his face while his younger rivals agonized behind him on the summit finishes.
"I loved this course. When I first saw the design I knew it was perfect for me and my style of racing," Horner said.
The veteran rider was not among the favorites entering the race, but he quickly joined them upon winning the third stage. That made him the oldest rider to ever win a stage at a grand tour, breaking the former record held by Pino Cerami, who won a Tour stage at 41 years, 2 months.
Saturday's decisive stage saw Horner resist Nibali's repeated attacks before leaving him behind in the fog as he surged up the Alto de L'Angliru peak, increasing his lead from three to 37 seconds.
"Yesterday you saw how much effort Nibali put in to try to win this race," Horner said. "It was no walk in the park for me. It was probably the hardest victory I've ever had in my career, and possibly the hardest race I've had in my career."
Horner completed the grand tour in 84 hours, 36 minutes, 4 seconds. Nibali remained 37 seconds behind, followed by Valverde 1:36 back.
Horner turned professional in 1995. His previous wins included the Tour of Georgia in 2003, the Tour of the Basque Country, a northern region on Spain, in 2010, and the Tour of California in 2011.
Euskaltel-Euskadi, the financially troubled Basque team that Formula 1 driver Fernando Alonso is considering sponsoring, finished as the best team at the race and the only won not have a member retire. The rest of the peloton let Euskaltel-Euskadi ride in front as it entered the city.