Serena Williams will face world number one Victoria Azarenka in the semi-finals of the Olympic women's singles after beating Caroline Wozniacki.
The American, who has two doubles gold medals, won 6-0 6-3 as Azarenka of Belarus beat Angelique Kerber 6-4 7-5.
overcame Kim Clijsters and plays compatriot
who upset Petra Kvitova.
In the men's last four,
Juan Martin del Potro
Olympic singles semi-finals
Federer (SUI) v Del Potro (ARG)
Murray (GBR) v Djokovic (SRB)
Azarenka (BLR) v Williams (USA)
Sharapova (RUS) v Kirilenko (RUS)
Swiss top seed Federer posted a 6-4 7-6 (7-5) victory over American John Isner to give himself an Olympic medal shot for the first time.
He goes up against 2009 US Open champion Del Potro after the Argentine edged out Japan's Kei Nishikori 6-4 7-6 (7-6).
"I think I'm playing my best," said Federer. "I don't know if you can play a whole lot better.
"You always have to keep on adapting your game, making sure you come up with a new plan, keep on playing well yourself.
"Overall I'm extremely happy. Obviously being in the medal matches, at least I'll get two shots.
"That's why I looked at this match as a finals. You can imagine the relief and happiness I feel right now."
Djokovic, a bronze medallist in Beijing four years ago,
set up an encounter with Murray
after seeing off Jo-Wilfried Tsonga.
Murray continued his impressive form by dispatching Nicolas Almagro 6-4 6-1 in just 59 minutes in front of his home crowd.
Serena beat Azarenka in the Wimbledon semi-finals in July
and is looking forward to meeting her again.
"I love playing Victoria, so it will be fun I have nothing to lose, she is world number one," said the 14-time Grand Slam champion .
"That's what I love, playing when I have nothing to lose so there is no pressure. No matter what happens I am in a medal round now so I'm excited."
meanwhile, is playing down her chances despite being one win away from contesting the gold medal.
"It [winning a medal] still seems really far away," she said. "I'm not thinking about it at the moment.
"I'm just focused on myself and hopefully the result will take care of itself. I just have to stay focused now."