Updated

Geneva, Switzerland (SportsNetwork.com) - Roger Federer finished off Switzerland's comeback against Kazakhstan in the Davis Cup quarterfinals, beating Andrey Golubev in the decisive fifth rubber Sunday after Stanislas Wawrinka started the comeback for the hosts with a four-set win over Mikhail Kukushkin.

Switzerland entered the day with a 2-1 deficit after Federer and Wawrinka were beaten in doubles on Saturday, but the duo redeemed themselves with singles victories on Sunday to give the hosts a 3-2 triumph in the best-of-five tie.

Wawrinka, who lost to Golubev on Friday in the opening singles match, quickly fell behind on Sunday against Kukushkin after dropping a first-set tiebreaker, but the Australian Open champion rallied to claim a 6-7 (4-7), 6-4, 6-4, 6-4 victory.

That set the stage for Federer, and the 17-time Grand Slam champion did not disappoint the home crowd. He notched a 7-6 (7-0), 6-2, 6-3 triumph in the fifth rubber to send the Swiss into the Davis Cup semis for the first time since 2003.

It also avenged a 5-0 loss to Kazakhstan in a 2010 world group playoff, the only previous Davis Cup meeting between the nations.

Switzerland will next host Italy in September. The Italians completed their own rally Sunday, winning the final two singles matches for a stunning 3-2 comeback against Great Britain, which was led by Andy Murray.

Golubev had carried the Kazakhs. After beating Wawrinka on Friday, he teamed with Aleksandr Nedovyesov to pull off a stunning four-set win over Federer and Wawrinka in Saturday's doubles contest.

Federer, however, was unfazed by an opponent he had never faced. He dominated the first-set tiebreaker after each player broke serve once, then broke serve twice in a strong second set.

The two traded early breaks in the third before Federer broke again for a 4-2 lead. He held in the next game and had little trouble in his final service game to finish the match in a little over two hours.

In the first match Sunday, Wawrinka blistered 25 aces and won 94 percent of his first-serve points. He managed the only three breaks of serve, one in each of the last three sets.

After coming up short in the first-set tiebreaker, Wawrinka finally broke serve for the first time for a 3-2 lead and it held up to square the match. Kukushkin was broken in the first game of the third set and it again proved to be the difference. He was not broken again until his last service game in the fourth set, which gave Wawrinka a 5-4 lead and he calmly held serve, finishing the match with an ace.

"I'm really happy with my game today," said Wawrinka. "I started to play a little more aggressive (after the first set), come in to the net more and take chances when I had them."

Kazakhstan has never advanced past the quarterfinals in Davis Cup play.