(CNN) -- Roger Federer kept his gold medal dream alive after a marathon semifinal battle with Argentina's Juan Martin Del Potro at Wimbledon Friday.
Federer had to dig deep to beat the former U.S. Open champion 3-6 7-6 19-17 in four hours 26 minutes, the longest match in Olympic tennis history.
He will play home hope Andy Murray, a repeat of last month's Wimbledon final, after the Briton swept aside Novak Djokovic 7-5 7-5 in the second semifinal.
A single break in each set was enough to give Murray his chance for revenge and gold.
"I know how much winning tonight meant to me. It was one of the biggest matches of my career, one of the biggest wins of my career," Murray told BBC Sport.
"It was one of the most emotional I've been after a match. I'm so happy to win. You don't see me smiling that much normally. I haven't stopped smiling since I came off the court.
"The atmosphere was unbelievable. We always said night matches at the U.S. Open had the best atmosphere, but it's not even close to what it was today."
Earlier, the 30-year-old Federer showed his fighting qualities after trailing by a set and struggling to impose himself in the second where he had to save two break points on his own service.
The tiebreak proved decisive as he gained a mini-break and held on to level the match.
The third set proved nerve racking with both players having break points before Federer broke in the 19th game.
But Del Potro immediately broke back to love as the drama continued on Centre Court.
Federer finally finished off his resilient opponent as he broke again to lead 18-17 and he took victory on his second match point.
"I don't think I've ever played as long a set in a best of three match," he told gathered reporters.
"It was very physical at the end and so mental. I got lucky in the second set to get back and then in the third it was so tough," he added.
World No.1 Federer is bidding to become the third man after Rafael Nadal and Andre Agassi to complete a career golden slam of the four grand slam titles and an Olympic singles title.
His Wimbledon triumph over Murray was his 17th grand slam title but he has now claimed his first medal in singles competition in the Olympics.
He won doubles gold with Stanislas Wawrinka for Switzerland in Beijing in 2008.
The women's singles final will be a mouth watering clash between Serena Williams of the United States and Russian Maria Sharapova.
Sharapova beat compatriot Maria Kirilenko 6-2 6-3, while Williams thrashed women's No.1 Victoria Azarenka of Belarus 6-1 6-2 in just 63 minutes.
Sharapova is competing in the Games for the first time and is also seeking a golden grand slam, but faces in Williams an opponent in ominous form after winning at Wimbledon last month.