Losses for Félix Auger-Aliassime to Roberto Bautista Agut (7-6 , 6-3) and Denis Shapovalov to Rafael Nadal (6-3, 7-6 ) ensured Spain claimed their sixth Davis Cup title - but Canada will return home with all the pride in the world.
The final is a best-of-three tie, where a doubles rubber would decide the outcome if the teams are level after the two singles matches. "I could not be happier, honestly".
Bautista Agut had given Spain a 1-0 lead by beating Felix Auger-Aliassime 7-6 (7-3) 6-3 in the first singles match.
Shapovalov played fearless and bold tennis, particularly in a high-class second set, but it was a fitting way for the season to end as its best player sealed victory on his third match point.
After both held serve until the second-set tiebreaker, Nadal squandered two match points - one on his own serve - then saved a set point while winning the final three points to clinch the title. I came to support the team with all my heart, but once we qualified for the final, I started to feel like playing.
The 33-year-old had been an unstoppable force in Spain's pulsating semi-final against Britain on Saturday and never looked like letting this chance slip, with King Felipe VI and Real Madrid's Sergio Ramos watching on, along with Barcelona defender Gerard Pique. Nadal is set to have risked injury to play in the Davis Cup. I think I could've played earlier this week: I felt ready as early as the quarterfinals.
All five of Spain's squad played a part over the course of the week but Nadal's colossal effort in front of the home fans at the Caja Magica proved the difference.
Pro-democracy opposition wins landslide in Hong Kong elections
His defeat was celebrated by more than 100 pro-democracy supporters in Tuen Mun, who cheered and popped open champagne bottles. More than 5,000 people have been arrested in the unrest that has contributed to Hong Kong's first recession in a decade.
Rafael Nadal gave all he had during the inaugural week-long Davis Cup Finals and his reward was a glorious victory for the hosts that meant so much.
After two thrilling semi-finals decided in tiebreakers of the doubles matches on Saturday, Spain outlasted Britain and Canada upset Russian Federation to play for the title of the new Davis Cup Finals, the World Cup of tennis. Roberto won the first singles match on Sunday, three days after the death of his father.
He matched Bautista Agut in the opening set until the tie-break, where the 31-year-old, who had been due to get married next weekend, used his experience to tempt errors from the youngster.
Shapovalov fended off break points in each of his first two service games before his fellow left-hander took a 4-2 lead with a rasping cross-court inside-out forehand victor.
Kosmos and the ITF hope to play the new Davis Cup in September instead of making it the season-ending tournament in November.
Shakira gave a stellar performance of "La La La" & "Tutu" at today's #DavisCup finals.
Canada were seeking a first Davis Cup title since debuting in the competition in 1913.