Rafael Nadal of Spain celebrates his victory over Juan Martin del Potro of Argentina during their 2017 US Open Men’s Singles semifinals match at the USTA Billie Jean King National Tennis Center in New York on September 8, 2017. DON EMMERT / AFP

Spain’s Rafael Nadal fought off tenacious Argentine Diego Schwartzman to win through to the quarter-finals of the Australian Open on Sunday, ensuring he remains world number one after the tournament ends.

Nadal was taken to four gruelling sets in almost four hours before winning 6-3, 6-7 (4/7), 6-3, 6-3 on Rod Laver Arena.

It was Nadal’s 10th Australian Open quarter-final appearance, second only to Roger Federer. He will next face Croatia’s sixth seed Marin Cilic. Nadal leads 5-1 in their previous meetings.

It was the Spaniard’s fourth win over the Argentine but his toughest after beating him in straight sets in the second round at the 2015 US Open.

Caroline Wozniacki also stormed into the quarter-finals by annihilating 19th-seeded Magdalena Rybarikova 6-3, 6-0 on Rod Laver Arena in her most impressive performance to date.

“She really mixes up the pace, I just tried to calm down, get my returns in and wait for the opportunities to attack,” she said after crushing the Slovak, who made the semi-finals at Wimbledon last year.

“I think you can tell my confidence is pretty good at the moment.”

By winning Nadal ensured that he will remain No.1 when the new rankings are released the day after the Open ends.

“Of course, I feel little bit tired, but yeah good. I was able to keep fighting until the end,” he said.

“It is the first big match I played in 2018. I started later than usual so a match like this probably helps because you know that helps confidence in myself.

“That’s confidence knowing that I can resist almost four hours on court playing at a good intensity.”

Nadal broke in the eighth game on the way to taking the opening set, but he encountered stiff resistance in the second set.

There were six service breaks as Nadal could not shake off the tigerish Argentine, who levelled the match by winning the tiebreaker when the top seed’s forehand was long.

There was a magical moment when Schwartzman ran down a drop shot and won the point with an angled volley across the net to break back at 4-4.

Nadal took control in the third set with a break in the fourth game, but he had to fight off five break points before holding serve in a titanic 13-minute second game in the final set.

He broke in the third game of the fourth set, but had to make some monumental holds of service to keep Schwartzman at bay, winning on his third match point with a return winner.

Diminutive Schwartzman, a quarter-finalist at last year’s US Open, was bidding to reach the last eight for the first time in Melbourne.

He endeared the crowd with his scampering around the court and his astonishingly powerful groundstrokes for one so small in stature.

British Kyle Edmund also qualified for the quarters by extinguishing Italian Andreas Sappi in four sets, 6-7 7-5 6-2 6-3.