Rafael Nadal battled back from the brink of defeat to beat Italian Fabio Fognini and reach the semi-finals of the China Open.
The Spaniard was a set and 4-1 down, but recovered to win 2-6 6-4 6-1 and extend his unbeaten run to 20 matches.
Nadal, 27, will regain the world number one ranking if he beats fourth seed
in the semi-finals.
Current world number one
will play French fifth seed
in the other semi.
Djokovic, the defending champion, swept past American Sam Querrey 6-1 6-2, while Gasquet defeated Spanish fifth seed David Ferrer 6-3 6-4 and Berdych beat eighth seed John Isner of the US 7-5 6-2.
A return to the number one ranking for the first time since July 2011 was looking unlikely for Nadal after he lost the first set against Fognini and was just a point away from trailing 5-1 in the second.
But the Mallorca-born left-hander - who looked to be struggling with his knee at one point - rediscovered his form, relinquishing just one more game to the world number 19 on his way into the final four.
Nadal is enjoying one of his best years despite missing the Australian Open with a knee injury, and he remains unbeaten on hard courts in 2013 having
won his 13th Grand Slam title at the US Open last month.
On the possibility of replacing Djokovic as world number one, he said: "It's something that doesn't create more pressure for me.
"It's something that already happened in the past. If that happens again, it will be good, it will be special for me."
- Novak Djokovic (Ser)
- Rafael Nadal (Spa)
- Andy Murray (GB)
- David Ferrer (Spa)
- Tomas Berdych (Cze)
- Roger Federer (Swi)
- Juan Martin Del Potro (Arg)
- Jo-Wilfried Tsonga (Fra)
- Stanislas Wawrinka (Swi)
- Richard Gasquet (Fra)
"It is not the moment to think about number one, it is the moment to think about Berdych or Isner."
Meanwhile, in the women's tournament, world number one
powered past sixth seed Caroline Wozniacki 6-1 6-4.
The Dane offered brief resistance to break Williams's serve in the sixth game of the second set before the 32-year-old American went on the offensive in a 38-shot rally in the seventh.
Williams, winner of 17 Grand Slam singles titles, extinguished any hope of a comeback to book a semi-final meeting with Poland's third seed
who beat Angelique Kerber of Germany 7-6 (9-7) 6-4.
"I felt I played really well tonight, especially in the first set," said Williams.
"I played well in the second set too, but I think Caroline just played so much better and she lifted her game so much.
"But I think overall it was the best performance I've had this week, which I'm excited about."
There was disappointment for home favourite Li Na, who was beaten 4-6 6-2 6-4 by 2011 Wimbledon champion
The Czech left-hander will face Serb
a 6-7 6-4 6-4 winner over Lucie Safarova, in the last four.