Rafael Nadal sealed Spain's first Davis Cup title since 2011 on home soil in Madrid but it was Roberto Bautista Agut who stole the show with an emotional victory just three days after the death of his father.
The world No 9 thrust his finger skywards after beating Canada's Felix Auger-Aliassime 7-6 (3) 6-3 and was in tears before addressing the crowd, who stood as one to cheer him.
That set the stage for Nadal, who had won all seven of his previous rubbers this week across singles and doubles, to ensure it was Spain who became the first winners of the revamped event, beating Denis Shapovalov 6-3 7-6 (7).
Having played in Spain's first two ties at the Caja Magica, Bautista Agut rushed home on Thursday after his father Joaquin was taken seriously ill, with the Spanish federation announcing the same evening that he had died.
That was assumed to be the end of Bautista Agut's tournament but he supported from the stands during Saturday's dramatic semi-final victory over Great Britain and was brought back into the action for the opening rubber of the final.
Canada had used only two players in making it to their first-ever final, with Shapovalov and Vasek Pospisil performing heroics in singles and doubles.
However, Pospisil was virtually running on empty against Russia in the semi-finals while their number two, 19-year-old Auger-Aliassime, was fully recovered from an ankle injury that had kept him sidelined for two months.
It was an intimidating stage for the teenager to make his return, especially given this was only his second Davis Cup tie.
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.
Perhaps not surprisingly, Auger-Aliassime looked rusty, with his forehand breaking down far too often and double faults peppering his service games.
Bautista Agut, by contrast, maintained his composure right the way through to the winning moment, when emotion understandably overcame him.
Nadal has been in such tremendous form that it felt like the first rubber was a must-win for Canada, and so it proved.
Shapovalov beat Nadal in his breakthrough tournament on home soil in Canada two years ago but was under the cosh from the start here.
Real Madrid defender Sergio Ramos, friend and rival of organiser Gerard Pique, was among the crowd to see the world number one crushing serves and forehands.
Shapovalov played brave 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.
An evening that had begun with a brief concert from Pique's partner Shakira ended with Nadal falling to the court and being jumped on by his team-mates as the Caja Magica celebrated to celebrate Spain's sixth Davis Cup success.