Updated

Shanghai, China (SportsNetwork.com) - Current No. 1 Novak Djokovic and former top-ranked great Roger Federer moved on, while British star Andy Murray came up a third-round loser Thursday at the $4.2 million Shanghai Masters tennis event.

The top-seeded two-time reigning champion Djokovic held off Kazakhstan's Mikhail Kukushkin 6-3, 4-6, 6-4 on the hardcourts at Qizhong Forest Sports City Arena.

Djokovic is undefeated in his last 12 matches in Shanghai and looking to lift the trophy here for the third year in a row. Already a Masters winner in Indian Wells, Miami and Rome this season, the 27-year-old star is chasing his 20th Masters title. He dismantled Tomas Berdych for the China Open championship last week in Beijing.

Djokovic, who beat Juan Martin del Potro in last year's Shanghai finale, has now won his last 27 matches in China.

The third-seeded 2010 Shanghai runner-up Federer cruised past 14th-seeded Spaniard Roberto Bautista Agut 6-4, 6-2, while the 11th-seeded Murray gave way to fifth-seeded Spaniard David Ferrer, 2-6, 6-1, 6-2, on Day 5.

Ferrer moved ahead of Murray in the ATP "Race To London" and broke a two-match losing streak against the Brit in the pair's 13th meeting (Murray leads, 7-6).

"I needed to play my best tennis today," said Ferrer. "Of course it's my goal, and the goal of Andy. I think this match was very important for both players. Today was a good victory."

Murray captured his first title in 15 months in Shenzhen, China, two weeks ago and was a semifinalist in Beijing last week.

He titled in Shanghai in 2010 and 2011 and was the runner-up here in 2012.

Meanwhile, a sixth-seeded Berdych handled 6-foot-10 Croat Ivo Karlovic 6-3, 6-4 and Spanish left-hander Feliciano Lopez bounced 13th-seeded towering American John Isner 6-3, 6-4.

Also on Thursday, France's Gilles Simon grounded Tunisian qualifier Malek Jaziri 6-2, 6-3, Russian Mikhail Youzhny overcame Argentine wild card Juan Monaco 5-7, 6-3, 6-2, and Frenchman Julien Benneteau dismissed American Jack Sock 6-3, 6-4.

Friday's quarterfinals will pit the Wimbledon champion Djokovic against the 2011 Shanghai runner-up Ferrer; the Wimbledon runner-up Federer versus Benneteau; Berdych against Simon; and Youzhny versus Lopez.

This week's big winner will collect $798,450.