Roger Federer got one over his old rival Rafael Nadal to win the Shanghai Masters 6-4, 6-3 on Sunday in a showdown between the two best players on the planet. It was a 94th title for the Swiss legend, drawing him level with the great Ivan Lendl, and closes the gap on world no 1 Nadal at the top of the rankings as the season reaches its conclusion.

In-form Nadal was ahead in their overall record down the years, with 23 wins to Federer’s 14, but he was up against it almost right away. This was Federer’s fifth straight win against Nadal, achieving the feat for the first time.

Number two Federer put Nadal under the cosh immediately on the Spaniard’s serve, breaking him in the first game – to roars of approval from the majority inside the arena. The 36-year-old Swiss, fondly known as “Cow” in China for his laid-back personality, had started the better and he rattled through his own service game for 2-0.

Federer, a 19-time Grand Slam champion who had beaten Nadal in their last four encounters, was in full flow under the Qizhong Tennis Center roof, which was closed because of downpours in Shanghai.

Nadal, 31, groaned while lashing many of his shots; Federer was all quiet efficiency. Somewhere in the stadium somebody rattled a cow bell. Federer rapidly made it 4-2 with two booming aces in a row, drawing huge cheers from much of the stadium.

In contrast, Nadal – a 16-time Grand Slam winner but who had never won the Shanghai Masters – was labouring through his service games. He went long on a straightforward forehand but powered an ace to make it 4-3 to the Swiss.

There were suggestions that Federer might not be quite as fresh as his old 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 pivotal fifth game.

Nadal, on a great run of form that won him the US Open and China Open in recent weeks, saved the first break point but could not survive the second one to put Federer in reach of a second Shanghai Masters crown.