It was a vintage Federer performance as the second-seeded Swiss secured the 71-minute win over the top-seeded Spaniard to clinch a second Shanghai crown (2014) and 27th at the ATP World Tour Masters 1000 level.
"I don't know what my expectations were going in," Federer said after the match. "I thought I might struggle early on because it was a late finish last night.
"In a way, it's not surprising, because I did feel good all week, and it does pay off to arrive early to an event. You can't do it all the time, but I was here since Thursday late night and that's five, six days to prepare for a Wednesday match. So I was ready."
Federer notched his 700th match victory on hard courts and improved to 10-1 against a top-10 opponent this year. It was the 94th title in Federer's career, which pulls him level with Ivan Lendl for second on the Open Era list. Only Jimmy Connors owns more trophies with 109.
The 36-year-old Federer also extended his winning streak over the 31-year-old Nadal to four matches this year and five straight overall.
Federer added a sixth title and third at the Masters 1000 stage in 2017. Having also prevailed in Indian Wells and Miami, it marks the fifth time in his career in which he has captured at least three such championships.
With the win, Federer draws to within 1,960 points of Nadal for the top spot in the Emirates ATP Race To London, with year-end No. 1 still very much in play. Both will be competing at the Swiss Indoors Basel, followed by the Rolex Paris Masters and Nitto ATP Finals.
"I had no nerves really before the match, which was nice," Federer said. "I was pretty clear about how I wanted to play the match. And then I came out and started off very well. Felt relaxed from then on. I always know that Rafa can come back at any moment if he connects well, picks the right sides, and does the right things.
"I even felt that way being up 0/40, you know, going for the double break, but, I had a clear game plan and felt I was playing well all week. I think that settled my nerves, because I was returning well from the first match here. ... The serve only got better. I guess I saved the best for last."
Nadal leads their head-to-head rivalry 23-15, but Federer continues to close the margin as he capitalized on the fast conditions Sunday under the lights on Stadium Court.
Federer was asked about his chances of catching Nadal in their head-to-head record.
"It's not going to happen. We don't have enough years left on the tour," Federer said. "We ranked too good so we play each other only in finals at the moment. ... You can't win them all against Rafa, to be honest. He's too good of a player."
Federer snapped Nadal's 16-match winning streak, which included his China Open victory last week.
"It was a very difficult match for me," Nadal said. "He played very fast and he played well. I don't know how many unforced errors he made. I could have done some things better, but that's it. He just played too good. That's my point of view. So congrats to him.
"I played a fantastic tournament, having very good wins. Very pleased the way I played the whole Asian tour for me. Beijing and Shanghai have been a very positive two weeks for me. A lot of points, a lot of victories against great opponents. I come back with very good personal satisfaction the way that I played."