Novak Djokovic rallied to beat Argentinian Juan Martin Del Potro in three sets 4-6, 6-4, 6-4 early on Thursday to advance to the Mexican Open quarterfinals.

Djokovic, playing in his first tournament since his shocking loss in the second round of the Australian Open, struggled to beat Del Potro, the 2009 U.S. Open winner, who ousted the Serbian 7-6 (4), 7-6 (2) in the first round of the Olympic Games in Rio de Janeiro.

It was the first match between them since.

"Every time you play against Delpo, there's a lot of tension, emotions and quality of play," Djokovic said. "I'm happy I was able to beat him this time."

The 29-year-old Serbian, ranked No. 2, suffered an unexpected loss to Uzbekistan's Denis Istomin on the Australian Open.

Djokovic, making his debut in Acapulco, was losing 4-3 in the third set, but he broke Del Potro twice and was able to preserve his serve to get the victory.

Del Potro could not defend his one-set lead (Getty)

The Serbian star will play against Australian Nick Kyrgios, who qualified with a 6-2, 6-4 victory over American Donald Young.

Spaniard Rafael Nadal routed Italian Paolo Lorenzi 6-1, 6-1 earlier to move on to the next round. Nadal won the tournament in 2005 and 2013 and has a 12-match winning streak in the event.

"Unfortunately, I will lose eventually," Nadal said. "But the harmony with the crowd and the court is amazing. With all of the support from the people, it gets easier."

Nadal eased past Lorenzi in straight sets (Getty)

The 30-year old Spanish star will face Japan's Yoshihito Nishioka, a 6-4, 3-6, 6-0 winner over Australia's Jordan Thompson.

Nadal is playing in his first tournament since losing to Roger Federer in the Australian Open final.