The 33-year-old Swiss, a five-time champion here, will play for a spot in his second Masters 1000 final in as many weeks on Saturday against Canadian fifth seed Milos Raonic, a winner over Italy's Fabio Fognini 6-1, 6-0.
Second seed Federer took 93 minutes to storm to victory after trailing 4-1 in the second set.
Federer is bidding for the 80th title of his career. The Wimbledon finalist has now won 16 of his last 18 matches after playing last week's Toronto final.
"I started well, I was hitting the ball well," said the 17-time Grand Slam champion. "I was the more aggressive player out there. I was having more impact from the baseline
"I deserved that first set. In the second I lost a little rhythm and everything got tougher for me.
"I got a little down on myself after the second break but I knew it's not been so easy for him to close out matches. I stole that second set in the end."
Federer won four second-set games to take a 5-4 lead after winning the opening set. He then earned a match point on the Scot's serve in the next game, clinching the victory from a Murray forehand into the net.
"I was obviously well up in the second and blew it. It's a shame," Murray said.
Federer owns a 5-0 record over Raonic, with their last meeting coming at Wimbledon.
"This court suits him the best. He gets a bit more time to set up shots." said Federer. "But it's simple against a big server; you have to focus on your own game, keep him moving and use variety.
"It's a tough match-up but I've done well against him and I hope for one more like that tomorrow."
Federer's first break in the opening set Friday came on his seventh opportunity, with the Swiss saying that he never gave up on his game.
"I was playing too well to get down on myself, I took the missed break points as a good sign. I stayed positive out there," he said.
"I felt this could be a good night for me and I wasn't mistaken."
Murray, still without a title since his emotional Wimbledon triumph of 2013, is now level 11-11 with Federer as he lost serve five times to the Swiss.
Raonic will be playing his fourth Masters semi-final of the season when he meets Federer. He beat Fognini with a modest seven aces but broke the quirky Italian six times.
At the top of the draw, France's Julien Benneteau won 12 of the last 15 games to stun Australian Open champion Stan Wawrinka 1-6, 6-1, 6-2 to reach the first Masters semi-final of his career.
Benneteau made a quick recovery after losing the first set, completely turning the match around. He finished off the victory with an ace on the first of two match points.
The Frenchman will play Spanish sixth seed David Ferrer, who beat countryman Tommy Robredo 6-4, 3-6, 6-3, a day after the 16th seed beat sluggish Novak Djokovic.