Radek Stepanek was the hero as the Czech Republic won the 100th Davis Cup final against Spain in Prague.
It all came down to a deciding fifth rubber, with Stepanek seeing off world number 11 Nicolas Almagro 6-4 7-6 (7-0) 3-6 6-3 to give his nation a 3-2 win.
David Ferrer had earlier brought Spain level at 2-2 with a 6-2 6-3 7-5 victory over Tomas Berdych.
2012 Davis Cup final
- Friday (Cze 0-1 Spa):
David Ferrer (Spa) bt Radek Stepanek (Cze) 6-3 6-4 6-4
- Friday (Cze 1-1 Spa):
Tomas Berdych (Cze) bt Nicolas Almagro (Spa) 6-3 3-6 6-3 6-7 6-3
- Saturday (Cze 2-1 Spa):
Berdych/Stepanek (Cze) bt Granollers/Lopez (Spa) 3-6 7-5 7-5 6-3
- Sunday (Cze 2-2 Spa):
Ferrer (Spa) bt Berdych (Cze) 6-2 6-3 7-5
- Sunday (Cze 3-2 Spa):
Stepanek (Cze) bt Almagro (Spa) 6-4 7-6 3-6 6-3
While Czechoslovakia won the Davis Cup in 1980, this is the Czech Republic's first victory as an independent nation.
"I was dreaming about it my whole life and now we're standing here as Davis Cup champions, it's amazing," said Stepanek.
"I can't describe what I'm feeling right now. I came on the court with the mindset that I had to stay calm, hungry, motivated and concentrate.
"I was playing very aggressively today. I wanted to be the one who was active, who was controlling the game and it paid off."
Berdych had needed nearly four hours to beat Almagro in the second singles on Friday and then played in the doubles win on Saturday, so it was no surprise that he ran out of gas against Ferrer in Sunday's first singles match.
Spain's world number five has enjoyed the best year of his career and had too much for Berdych, winning in a little under two-and-a-half hours to bring the defending champions level.
A world ranking of 37 suggested the 33-year-old Stepanek was a considerable outsider against Almagro, six years younger and ranked 26 places higher.
But the backing of most of the 13,000 spectators inside Prague's O2 Arena helped Stepanek, as did a fast surface that suited his attacking style.
Team events in tennis
- The Hopman Cup
is an invitational team-based tournament that consists of eight teams comprising one male and one female.
- The Fed Cup,
previously known as the Federation Cup, describes itself as the world's largest annual international team competition in women's sport. 90 nations entered in 2012.
- The Davis Cup,
which began in 1900 as a competition between USA and Great Britain, is the main team event for men. It's now the world's largest annual international team event, with 123 nations entering in 2012.
He edged the first set with the only break and threatened far more in the second, seeing four set points slip by before dominating the tie-break.
Almagro was in deep trouble at two sets down and 0-40 at the start of the third, but he dug himself out of trouble and managed to take the set.
As the three-hour mark passed, the Spaniard might have felt he had an advantage against the older man but Stepanek was having none of it.
The Czech surged into a 3-0 lead in the fourth set and kept his nerve superbly to hold on and convert his second match point, sparking scenes of wild celebration as his team-mates raced onto the court.
"These are very tough moments," Almagro told Spanish broadcaster TVE after the defeat. "But we can't be down on ourselves in any way as we fought to the last moment.
"We are runners-up in the Davis Cup. We are leaving with our heads held high knowing that we did a good job."
The result means the Czech Republic are the first nation to simultaneously hold the Davis, Fed and Hopman Cups.