The surprisingly one-sided 6-4, 6-3 victory over the world number one from Spain brought a 94th title for the Swiss legend, drawing him level with the great Ivan Lendl.
Nadal, who admitted afterwards that he had been defeated by the better man on the night, was ahead in their overall head-to-head record going into the clash – 23 wins to Federer’s 14.
But this time he was up against it almost right away.
Number two Federer put the Spaniard under the cosh in breaking him in the first game, to roars of approval from the majority inside the arena.
Another break to 36-year-old Federer in the fifth game of the second set put him in reach of a second Shanghai Masters crown — and a sixth title in 2017.
Federer, who has been managing his schedule to wring the best out of his ageing body, said he had improved as the week went on and felt he hit peak form just when it mattered.
“It’s been a tough week, five straight matches is always a test and a challenge for anybody’s body, especially with the pressure rising,” he said.
“I felt I was playing well all week and that settled my nerves because I was returning well from the match here against (Diego) Schwartzman (in his opener).
“The serve only got better and I saved the best for last – I played some great matches, against (Juan Martin) del Potro in sets two and three and now these two sets here today.
“In a way not surprising because I felt good all week… I was ready.”
Federer, fondly known as “Cow” in China for his laid-back personality, started the better in grabbing the break and then rattled through his own service game for 2-0.
Federer, a 19-time Grand Slam champion, was in full flow under the Qizhong Tennis Center roof, which was closed because of downpours in Shanghai.
Nadal, 31, fresh from winning the US Open and China Open, groaned while lashing many of his shots while Federer was all quiet efficiency.
Somewhere in the stadium somebody rattled a cow bell and Federer responded by making it 4-2 with two booming aces in a row.
In contrast, Nadal — a 16-time Grand Slam winner who has never won the Shanghai Masters — was labouring through his service games.
There were suggestions that Federer might not be quite as fresh as his younger foe, having been pushed to three sets a day earlier in the second semi-final against Juan Martin del Potro.
The timeless Federer rubbished that notion as he seared his way to a 5-3 first-set lead.
Nadal sent down his fourth ace for 5-4, only for Federer to seal the set with his seventh ace of the match.
There was little between the great rivals in the early exchanges of the second set until the fifth game.
Nadal saved the first break point but could not survive the second one, to put Federer in touch of the title.
Nadal’s defeat sees Federer close the gap at the top of the world rankings as the year approaches its climax. But the Spaniard has nevertheless enjoyed a remarkable season of his own.
His triumph in Beijing last weekend was also his sixth of the year as he continues to defy doubts about his fitness following repeated injuries.
The Spaniard called it “an emotional year”.
“I could maybe have done some things better,” said Nadal.
“Of course was not the best match of the week for me… but when someone plays better than you in most of the things that really matter in this sport, then it’s tough.”
He declined to say if he had been hampered by a problem with his right knee, which had a bandage on it during the match.
“I don’t want to talk about that now, sorry,” Nadal said.
“After losing a final it’s not the moment.”
* Story provided by AFP
Rafael Nadal will play Marin Cilic in the semi-finals of the Shanghai Masters on Saturday after the world number one was forced to fight past Grigor Dimitrov 6-4, 6-7 (4/7), 6-3.
The Spaniard, who has never won the Shanghai showpiece, is chasing a seventh title in a brilliant season and a hat-trick of triumphs on the trot, having been crowned US Open and China Open champion in recent weeks.
The 16-time Grand Slam winner saw off the Bulgarian Dimitrov in Beijing last week but suffered some hairy moments in getting the better of him again in a nervy quarter-final played in overcast conditions.
Top seed Nadal, 31, grabbed the crucial break of serve in the ninth game of the first set and there was nothing between them as they entered a tense second-set tie break.
Nadal got the mini-break for a 3-0 lead in the tie break, but sixth seed Dimitrov scrapped back to level, and then stunned the Spaniard to clinch the tie break.
The two friends headed into a deciding set with Dimitrov in the ascendancy and the pro-Nadal crowd fearing an upset.
Dimitrov sensed another opportunity in the fifth game of the third set, but Nadal survived the break point.
Nadal took the momentum into the next game to immediately break Dimitrov and finally end the Bulgarian’s resolve.
The Spaniard’s victory march was only momentarily held up when a disturbance broke out in the crowd and the players were forced to wait as a small group of spectators was escorted out of the arena.
A relieved Nadal looked up to the heavens and raised his arms at the end.
The Croatian fourth seed Cilic beat the unseeded Spaniard Albert Ramos-Vinolas 6-3, 6-4 for a date with Nadal.
Cilic, bidding to reach the season-ending ATP Finals in London, grabbed the critical break in the sixth game of the first set on his way to a comprehensive victory.
Cilic said consistency was key.
“My team has worked really well in all parts of my game just to bring it up to the nice level that I can keep it up throughout every single week,” he said.
“I got to understand also all the things that we were working on.
“They are quite clear for me and I also am a little bit more consistent this year in serving performances.
“I’m winning quite a lot of service games and a lot of matches.”
The remaining two quarter-finals pit number two Roger Federer against unseeded Frenchman Richard Gasquet, the winner will play Argentina’s Juan Martin del Potro or Viktor Troicki of Serbia in the last four.
ATP MD match wins
1. Connors, 1256
2. Federer, 1121
3. Lendl, 1068
4. Vilas, 929
5. McEnroe, 877
6. Agassi & Nadal, 870
8. Djokovic, 783
— José Morgado (@josemorgado) October 13, 2017
The seasoned Argentine recovered to win 3-6, 7-6 (5), 6-4 in one hour, 55 minutes against the 20-year-old Zverev and will next play either Viktor Troicki or John Isner.
Zverev was going after his sixth title of an outstanding season and was comfortable in the first set against Del Potro, the 2009 US Open champion and 16th seed.
The German prodigy and the 29-year-old, whose career has been beset by injury, went toe to toe in the second set and the tie break was just as tight until Del Potro grabbed the crucial mini-break.
And then came the turning point – and the flash of anger from third seed Zverev – as he yielded the crucial service break to go 3-2 down in the third set.
“Right now I’m very pissed off, as you can probably tell,” said Zverev afterwards, having smashed the racquet on the court, then trodden on it, and brutalised it further as he stomped back to his chair.
A fan at least came away with a demolished racquet after Zverev handed it to a spectator.
“I don’t understand how I can lose a match where I get broken one time in three sets and not managed to get any chances on his serve,” said Zverev, the world number four tipped to one day top the rankings.
“I’m a bit pissed off because I feel like I played well and that’s the upsetting part of it – I could have done great in this tournament.”
The Bulgarian Dimitrov defeated American Sam Querrey 6-3, 7-6 (7/3) and Spain’s Ramos-Vinolas saw off Germany’s Jan-Lennard Struff 7-6 (7/4), 6-4.
— Live Tennis (@livetennis) October 12, 2017