The seven-time champion beat fellow Swiss Stan Wawrinka 6-7 (2/7), 7-6 (8/6), 6-2.
The match was interrupted for 21 minutes with players being sent off court and crowds told to seek shelter as a storm cell passed near the site.
But after the pause, the pair came back out, with Federer finally securing the first break of the match on his seventh chance to take a 4-2 lead over his longtime rival.
Federer closed out victory two games later and will face David Goffin after the Belgian beat Juan Martin del Potro 7-6 (7/5), 7-6 (7/4).
Federer began his day by beating Leo Mayer 6-1, 7-6 (8/6).
"It's quite unusual to stop for lightning," Federer said after beating Wawrinka for the 23rd time in 26 meetings.
"I didn't know if it meant the end of the night or that we would come back.
"I got my energy back for the third set, a momentum shift was good for me. It was also good that I was serving first.
"I played a cleaner third set. I was clear with my game plan. It was good to win two matches today."
Elsewhere, former world number one Novak Djokovic also won his second match of the day to set up a semi-final clash with Marin Cilic.
Djokovic, a five-time finalist here who has never broken through, is aiming to lift the trophy at the only one of the Masters 1000 series events that he has never won.
The Serb tenth seed followed up a 2-6, 6-3, 6-4 third-round defeat of holder Grigor Dimitrov earlier in the day of a rainy week by beating Milos Raonic 7-5, 4-6, 6-3.
It was the ninth win without a loss for Djokovic in the series with the Canadian.
"I've played five finals here," Djokovic said. "But I do wish to win the title.
"I'm here to enjoy a sport that I love, I've got plenty of motivation. I'm in a good position, so I'll take it step by step."
Djokovic had to come from behind in the first and third sets, and helped seal the victory with a break for 5-3 in the third.
"Milos is one of the best servers in the game," Djokovic said. "Just a few points decided the winner.
"It's tough to play against someone serving so big."
Cilic put out Spanish 13th seed Pablo Carreno Busta 7-6 (9/7), 6-4.
"I haven't played any matches on the centre court. I feel and I heard that it's completely different. It's much faster," Cilic said.
"Definitely Novak is playing really well. His level was definitely high and he's in definitely really good form.
"We played tough match in Queen's, but that's grass and definitely different. So I have to get ready and give it a full shot."
Women's top seed Simona Halep recovered from 1-4 down in the opening set to defeat Lesia Tsurenko 6-4, 6-1.
It was the second fightback of the day for Halep, who came from a break down in each set to overhaul Australian 16th seed Ashleigh Barty 7-5, 6-4 several hours earlier in the third round.
Double Wimbledon winner Petra Kvitova reached the final four over Belgian Elise Mertens 7-5, 5-7, 6-3.
She will face Kiki Bertens after the Dutchwoman defeated Ukrainian fifth seed Elina Svitolina 6-4, 6-3.