The resurgent Swiss veteran, who has climbed back to third in the world this season while Murray has dropped to ninth, eased through the opening set, with Murray only staying in it for as long as he did by saving half a dozen break points.
The Scot then dug in at the start of the second set, building a 4-1 lead.
But Federer then won four games in a row to get his nose in front, and Murray lost his service once again a couple of games later to bring the game to an end.
"I don't remember hitting very many good shots after the 4-1 game," said a disconsolate Murray after the match.
"I blew it, it's a shame."
Federer was delighted to have claimed the match in straight sets after his wobble.
"In the second set, I lost a little bit of the rhythm," Federer told ESPN.
"From the baseline, he was hitting the ball well - harder and deeper... I snuck in a quick break, and next thing you know, I'm back. I feel like I stole that second set…
"I hit the ball well," Federer added. "I was the more aggressive guy out there. I was having more impact from the baseline and on the serve."
Federer will face Canadian fifth-seed Milos Raonic in Saturday's semi-finals with surprising Frenchman Julien Benneteau meeting Spain's David Ferrer in the other.
Raonic breezed past 15th seed Fabio Fognini of Italy 6-1 6-0 in a quarter-final mis-match that lasted only 57 minutes.
Benneteau delivered the day's shock with a 1-6 6-1 6-2 ousting of Swiss world number four Stan Wawrinka to reach his first Masters semi-final.
Benneteau belted nine aces and broke serve four times as he earned his second victory over a top-10 opponent this year and became the first Frenchman in 14 years to advance to the Cincinnati semis.
Ferrer outlasted fellow Spaniard Tommy Robredo 6-4 3-6 6-3 a day after Robredo, the 16th seed, had stunned world number one Novak Djokovic.
- Sports & Recreation