Nadal got by Fabio Fognini 2-6, 6-4, 6-1, recovering from a first set in which Fognini raced out to a 5-1 start and was also up a break early in the second set. Nadal saved a game point that would have put Fognini ahead 5-1 in the second and took over from there.
He won the next five games to even the match and was soon ahead 4-1 in the third set.
"Then the situation changed a little bit," Nadal said after the match. "I played a little bit better, played with a little bit more rhythm and he felt that he needed to play another shot to win the point. But it was too late. I was very lucky."
Nadal will ascend to the No. 1 ranking if he wins Saturday over fourth-seeded Tomas Berdych. Current No. 1 Novak Djokovic, even if Nadal loses, must repeat as China Open champion to retain the top ranking.
Djokovic served noticed he's not going quietly, routing Sam Querrey 6-1, 6-2 in 52 minutes. Djokovic lost five points -- one in the first set -- while finishing off four of his 12 break chances.
Nadal will play Berdych in the first semifinal Saturday. He is 15-3, with a 14-match winning streak dating to 2006, against Berdych. Djokovic is a healthy 8-1 all-time against Gasquet.
Swim Week Miami Beach 2014 [PHOTOS]