Russia knocked reigning champions Spain out of the Davis Cup on Sunday to set up a quarter-final against Sweden.
The Russians' tie against the depleted Spanish team came down to a late-night doubles encounter in Madrid.
Aslan Karatsev and world number five Andrey Rublev won 4-6, 6-2, 6-4 against Marcel Granollers and Feliciano Lopez to win Group A and deprive the Spanish team of the chance to play in front of a home crowd in Madrid on Thursday.
The Russians, playing under the name of the Russian Tennis Federation because of sanctions against Russian sport for doping, made a bad start to the tie when Lopez beat Rublev 2-6, 6-3, 6-4 in the opening singles rubber.
US Open champion Daniil Medvedev stepped up to bring the tie level with a 6-2, 7-6 (7/3) win over Pablo Carreno Busta, before the doubles decided the match.
Britain booked their place in the last eight with a come-from-behind victory over the Czech Republic on Sunday and will play Germany in Innsbruck on Tuesday.
Kazakhstan and Croatia also reached the last eight.
Dan Evans' surprise 6-2, 7-5 loss to world number 143 Tomas Machac left Britain needing to fight back to secure a second straight win and take top spot in Group C.
But Cameron Norrie overcame a second-set blip to see off Jiri Lehecka 6-1, 2-6, 6-1, before Joe Salisbury and Neal Skupski teamed up to beat Machac and Jiri Vesely 6-4, 6-2 in Innsbruck.
"We've been underdogs and managed to get wins. The Czech team played well — very young team. Machac turned into a top 20 player overnight!" British captain Leon Smith told the BBC.
The ties in Austria are being played behind closed doors due to new coronavirus restrictions in the country.
France, after winning against the Czechs and losing to Britain, are out of the tournament.
Germany backed up their shock victory over Novak Djokovic's Serbia by fighting back to edge out hosts Austria and go through as Group F winners.
Serbia had to settle for second place but progressed to a quarter-final against Kazakhstan in Madrid on Wednesday as one of the best runners-up.
Dominik Koepfer lost 6-1, 7-5 to Jurij Rodionov to put the Germans in trouble, but Jan-Lennard Struff levelled the tie by cruising past Dennis Novak 7-5, 6-4.
Kevin Krawietz and Tim Puetz completed the job in the doubles, as they did against Djokovic and Serbia on Saturday, winning 6-3, 6-4 against Oliver Marach and Philipp Oswald.
Croatia just needed to win one rubber against Hungary to wrap up first place in Group D and the 242nd-ranked Nino Serdarusic did just that in the opening match against Fabian Marozsan in Turin.
His 6-4, 6-4 success helped avoid a nervy finish to the tie for the two-time winners, as Marin Cilic lost the second singles 4-6, 7-5, 6-4 to impressive Hungarian youngster Zsombor Piros.
Italy will have the advantage of home support when they face the Croatians in Turin on Monday.
Kazakhstan moved into the knockout stage by downing 2019 runners-up Canada in Madrid.
Kazakhstan, which beat Sweden on Saturday, emerged victorious again thanks to singles wins for Mikhail Kukushkin and Alexander Bublik, over Brayden Schnur and Vasek Pospisil respectively.
Bublik drew the ire of the Spanish crowd for delivering an underarm serve at 4-4 in the second set, but that only seemed to spur him on.
"As one legend says, when you go to sleep guys, know that I won because of you," he said to the crowd, referring to US Open champion Medvedev.
The tournament was postponed last year because of the Covid-19 pandemic.