Spanish player Rafael Nadal won gold with Marc Lopez in the men's doubles tournament at the Summer Games on Friday, but he had to claw his way into the tennis singles semi-finals.
The Spanish duo beat Romania's Florin Mergea and Horia Tecau 6-2, 3-6, 6-4.
In the singles quarter-finals earlier on Friday, 2008 gold medallist Nadal beat Brazil's Thomaz Bellucci 2-6, 6-4, 6-2.
After having lost the first set against Belluci, the Spanish nine-time French Open champion turned around the match despite the home crowd's excited support for their native underdog.
In the semi, Nadal will face Argentina's Juan Martin del Potro, who has ousted top-seeded Novak Djokovic of Serbia in Rio.
"Being at the semifinals is something that a few days ago I wouldn’t even imagine," said Nadal, who had arrived in Rio with a wrist problem.
"I don’t even know how things are going so well because I didn’t do any preparation for the tournament, but I’m playing with a great attitude, fighting hard for each point, fighting to the end," he added.
Wimbledon champion Murray also struggled to reach the semis. He only managed to overpower US player Steve Johnson in the tiebreak of the third set with a 6-0, 4-6, 7-6 (7-2) win.
The world number two Murray will face off with Japanese player Kei Nishikori in his semi-final match on Saturday.
"For me it has nothing to do with having won the gold in London. For me it's about trying to win more medals for the country and the team," Murray said.
Puerto Rican tennis player Monica Puig achieved the day's most notable upset when she beat Czech world number 14 Petra Kvitova 6-4, 1-6, 6-3 to advance to the Olympic final.
Puig, ranked 37th in the world, is assured at least a silver medal - the first Olympic tennis medal for her country, and the first Olympic medal for a Puerto Rican woman.
"I had to be really positive and be as aggressive as I could, and I think that worked. I just can't believe where I am right now," Puig said.
In her match against double Wimbledon champion Kvitova, Puig lost her serve at the start of the contest and was behind 3-0. But she rallied to win the opening set 6-4 after 36 minutes.
Kvitova returned to form in the second set, taking the score to 6-1 in 35 minutes.
But the Puerto Rican hit back in the final set. After a battle that won over the Brazilian fans for Puig, the Puerto Rican sealed her victory after one hour and 53 minutes.
Puig, who jumped with excitement upon her victory, will play for gold Saturday against Germany's Angelique Kerber, the current world number two.