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.
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.
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.