The Czech Republic were winning their first Davis Cup since gaining independence following a 1993 split with Slovakia. Former Czechoslovakia won the trophy in 1980.
The victory has also handed the Czechs a rare team double after their women lifted the Fed Cup here two weeks ago -- a feat last achieved by the United States in 1990.
In Sunday's key rubber, a wild home crowd of more than 14,000 fans was all that Stepanek needed to shake off the fatigue from Friday's singles and Saturday's doubles.
His game against a rested Almagro went with serves until Stepanek capitalised on a single set point to break the Spaniard for a 6-4 win in the first set.