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 was a fifth victory in a row against world number one Nadal.

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.

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.

Another break to 36-year-old Federer in the pivotal fifth game of the second set put him in reach of a second Shanghai Masters crown – and a sixth title in 2017.

“We didn’t think maybe we were going to have the year we did, I definitely didn’t,” Federer said on court afterwards, looking at Nadal, reflecting on their continued success even at this late stage of their careers.

“It’s nice to share this court with you today and I hope there are more to come in the tournaments we’ve got left. It’s been a pleasure playing against you here today.”

Federer, fondly known as Cow in China for his laid-back personality, had started the better in grabbing the break and he 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 Centre 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; Federer was all quiet efficiency.

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.