MADRID — Canada’s historic run at this year’s Davis Cup continued Saturday with a semifinal win over Russia to put the Canadians into the final at the international tournament for the first time.

Denis Shapovalov of Richmond Hill, Ont., and Vasek Pospisil of Vancouver defeated Russia’s Andrey Rublev and Karen Khachanov 6-3, 3-6, 7-6 (5) in the deciding doubles match to win the semifinal tie 2-1.

The Canadians will play Spain in the final on Sunday after the tournament hosts rallied past Britain.

Canada fought back from 0-3 and 2-4 deficits in the tiebreak and earned a minibreak to go up 6-4. The Canadians converted on their second match point when a Pospisil serve was returned wide.

"The last five days it took a lot of emotions just to get to this match," Pospisil said. "So I think it’s just building, building, building and every match just feels that much more emotional and a huge success. And obviously to win that in a third-set tiebreak makes it that much more dramatic and that much more special.

"It’s pretty incredible to make the finals, first time in history for Canada. And to do it the way it happened was pretty special to be a part of."

Watch Canada vs. Spain in final of Davis Cup Watch Canada take on Rafael Nadal and Spain in the final of the Davis Cup on Sunday, Nov. 24 on SN Now and SN One. Action gets underway at 10:30 a.m. ET/7:30 a.m. PT.

Canada first appeared in a Davis Cup in 1913. The team’s best result was in 2013, when it reached the World Group semifinals before losing 3-2 to Serbia.

Pospisil, the Davis Cup veteran, started the day for Canada with a 6-4, 6-4 loss to Rublev. But Shapovalov, Canada’s top singles player at No. 15, responded by beating No. 17 Khachanov 6-4, 4-6, 6-4 to level the tie.

Pospisil, ranked 150th in the world in singles after missing the first half of 2019 following off-season back surgery, had been steady throughout Canada’s Davis Cup run, winning all but one of his singles matches.

The 29-year-old recorded three major upsets at the Finals, beating No. 12 Fabio Fognini of Italy, No. 36 Reilly Opelka of the United States and No. 48 John Millman of Australia this week.

"I’ve been on the Tour for 12 years now and this is an incredible moment to be a part of this, especially …. (because) I was injured at the beginning of this year, had surgery and wasn’t sure how many moments like this I might have," Pospisil said. "But I got back to a really high level much faster than I expected which was really nice.

"I worked really hard for that and to be here now playing the Davis Cup Finals for Canada it’s incredible. So I’m pretty thrilled."

Pospisil and Shapovalov, who have played every match for Canada this week, are both 5-2 including singles and doubles play.

Montreal’s Felix Auger-Aliassime, ranked No. 21 in the world, was slowed by injury at the start of the Davis Cup and hadn’t played a competitive match since the Shanghai Masters in early October. While Canada said the 19-year-old was cleared to play as early as Thursday’s quarterfinals, team captain Frank Dancevic elected to ride the hot hand in Pospisil against Australia and again versus Russia.

Rublev, No. 23, got the best of Pospisil early Saturday, breaking the Canadian three times to take the opening singles match in straight sets. Pospisil had 28 winners — including 15 aces — but was done in by 32 unforced errors.

Shapovalov evened the tie with a nearly two-hour long match to set up the decisive doubles. Shapovalov fired 11 aces to Khachanov’s six, but double-faulted six times. The Canadian converted on 3-of-5 break points and saved 5-of-7.

Two-time champion Russia was trying to make it to the final for the first time in 12 years.

Canada has been snapping losing streaks all tournament long.

The Canadian quarterfinal win on Thursday halted a string of nine previous Davis Cup defeats to Australia.

Canada also ended a losing run of 15 meetings against the United States, a team it had never beaten in the Davis Cup before this year.

"In terms of what we’ve been doing this week, there’s really no words for it," Shapovalov said. "I don’t think any of us expected that we could get this far. Obviously we know we have a great team but you have to have a bit of luck on your side and play some ridiculous tennis and play at a ridiculous level and I think we just absolutely played ridiculous (on Saturday)."

The new Davis Cup Finals is being played in World Cup-style with all 18 teams playing in a single venue in the same week.