Rafael Nadal beat Argentina's Juan Martin del Potro in a thrilling match to secure the Davis Cup for Spain.
World number two Nadal lost six games in a row in the first set but came back superbly to win a high-class encounter 1-6 6-4 6-1 7-6 (7-0) in Seville.
The victory was his 16th successive win in Davis Cup singles on clay and gave the hosts an unassailable 3-1 lead.
It secured Spain's fifth Davis Cup title and their third in four years, while Argentina have yet to win it.
"Today is one of the most emotional days of my career," said Nadal, 25, after winning the title for the third time.
"After such a difficult year, this was a spectacular finale to the season. To win a final this way is very special.
"We are very grateful to all the people of Spain. It was the best atmosphere I have experienced in my career."
A strangely out-of-sorts Nadal broke Del Potro in the first game but his opponent battled his way back into the match and dominated the Spaniard's serve to take the opening set to the delight of the Argentine fans in the 28,000 Olympic Stadium.
However, Nadal's indomitable spirit helped him halt Del Potro's run and he took the second set with a typically aggressive display that was greeted by a huge roar from the home supporters.
The 10-time Grand Slam winner took the third set in commanding style and the result looked to be a formality with Del Potro, who lost a near five-hour epic to David Ferrer on the opening day, seemingly tiring.
But, as the tension grew with each point, the Argentine dug deep and produced a series of magnificent winners to keep the tie alive, taking 10 points in a row and then breaking the Spaniard in the eighth game to give himself the chance to serve for the set.
However, amid increasing noise from the crowd, Nadal went on the attack and broke Del Potro's serve to level the set again.
Nadal broke his opponent again but Del Potro was not beaten yet and broke back immediately, firing a blistering forehand winner to take the set into a tie-break, in which the left-hander was unstoppable.
RESULT: SPAIN 3-1 ARGENTINA
Friday's singles: Nadal bt Monaco; Ferrer bt Del Potro
Saturday's doubles - Verdasco/Lopez lost to Nalbandian/Schwank
Sunday's singles - Nadal bt Del Potro
LAST 10 DAVIS CUP WINNERS
2011: Spain bt Argentina 3-1
2010: Serbia bt France 3-2
2009: Spain bt Czech Rep 5-0
2008: Spain bt Argentina 3-1
2007: USA bt Russia 4-1
2006: Russia bt Argentina 3-2
2005: Croatia bt Slovakia 3-2
2004: Spain bt USA 3-2
2003: Australia bt Spain 3-1
2002: Russia bt France 3-2