Murray has now beaten Federer in eight of their 13 matches
Andy Murray showed he is back on top form by beating Roger Federer in straight sets to win the Shanghai Masters.
The Briton finally put the memory of his early exit at the US Open well and truly behind him as he won 6-3 6-2 to claim his second title of the year and sixth at the elite Masters 1000 level.
He broke serve in the first game of the match and combined his usual breathless defence with numerous spectacular winners to come through in one hour 25 minutes, saving all six break points he faced.
Murray's surprise third-round defeat by Stanislas Wawrinka at Flushing Meadows last month had been followed by a listless display against Ivan Ljubicic in Beijing just nine days ago, but a kind draw in Shanghai helped the Scot work his way back into some form during the early rounds and secure a place at the end-of-season ATP World Tour Finals in London.
It was a great week - I played some of my best tennis
With that objective achieved, a more relaxed Murray then swept past Jo-Wilfried Tsonga and Juan Monaco before admitting he was relishing the chance to take on Federer in the final.
Murray had played his best tennis of the year in beating Federer to win the Toronto Masters in August, and with a 7-5 career record in his favour he has repeatedly proved that the Swiss star's game is one he can counter over the best of three sets.
The challenge of playing Federer clearly galvanises the Briton and he was switched on from the start of Sunday's final, whereas Federer looked distinctly edgy - some loose play handing the Scot a break point in the opening game before another wayward forehand gave up the break.
Murray was hitting the ball cleanly and confidently, and when Federer wasted a chance to get the break back in game three with a poor forehand drop shot, the unusually frustrated reaction from the Swiss said it all.
A desperately poor smash from Federer in game seven flew off the frame and almost allowed Murray to get the double-break, but the chance slipped by and the momentum briefly shifted away from the Briton.
Moments later, Murray double-faulted for the first time to give Federer a break-back point in game eight, but he responded brilliantly with an ace out wide and the danger had passed.
The set now back under his control, Murray closed it out with another break as he fired one brilliant winner down the line from deep behind the baseline, before racing in to collect a drop shot and whip a cross-court forehand past Federer on set point.
Federer was struggling but he had his chances at the start of the second set, twice failing to capitalise from 15-40, with one routine mid-court forehand particularly surprising as he blazed it way over the baseline.
Andy played great. He didn't give me much and made me work extremely hard
Murray was saving his best for the key moments, and his reaction to saving the fourth of those break points with a backhand winner after a pulsating rally showed the Scot's focus was not wavering.
Federer was increasingly forced into mistakes as he tried in vain to finish off the rallies quickly, with Murray finding a consistent depth with his groundstrokes and scrambling brilliantly, and after an errant call denied the Swiss at 1-2 and break point down, he then hammered a forehand into the tramlines on the replayed point.
The crowd sighed, Federer's shoulders slumped and Murray looked almost embarrassed as he raced through his next service game to take a 4-1 lead.
As he did in Saturday's semi-final win over Monaco, the British number one became stronger as the finish line drew closer and he sealed victory with his fourth break of the day to get his season back on track ahead of next month's end of season finale event in London.
"It was a great week - I played some of my best tennis, especially tonight," said the 23-year-old from Dunblane.
"You always have to play your best to have a chance against Roger. I managed to do that most of the week so I'm really pleased."
Federer, who is back at world number two following his semi-final win against Novak Djokovic, paid tribute to the champion.
"He had an outstanding tournament," said the 29-year-old, who has won 16 Grand Slam titles.
"It's not easy to win these Masters 1000 tournaments. I know how tough they are to win so congratulations on a great effort.
"I couldn't quite break through. Andy played great. He didn't give me much and made me work extremely hard - going for big shots which I couldn't pull off, which was unfortunate but I still had a great tournament."