MADRID (AP) — Novak Djokovic added another early elimination to his disappointing season, while Rafael Nadal continued to look invincible on clay.

Djokovic lost to Kyle Edmund 6-3, 2-6, 6-3 on Wednesday in the second round of the Madrid Open, the sixth straight tournament in which he has failed to reach the quarterfinals.

Nadal later cruised past Gael Monfils 6-3, 6-1, extending his record of consecutive sets won on clay to 48. The 16-time Grand Slam champion, coming off titles in Monte Carlo and Barcelona, has won 37 of his last 38 matches on the surface, including 20 straight.

Djokovic has struggled this year after saying he returned to action too quickly following a lingering right elbow injury.

"There are obvious things that are not working well for me," the 12-time Grand Slam champion said. "But I have to keep working on them and pray that ... and hope that my game will get stronger."

Djokovic lost in the third round in Monte Carlo and in the second round in both Miami and Indian Wells. The 12th-ranked Serb also failed to advance past the last 16 at the Australian Open.

"One or two points decide really these kind of matches," Djokovic said. "Luck was on his side a little bit. But, also, he was courageous enough to attack the balls when it mattered and deserved to win."

Djokovic played poorly in the first set but recovered to comfortably win the second. He had a chance to go up a break early in the third set but lost five straight points to allow Edmund to come back from 0-40. The unseeded British player then broke Djokovic's serve to go up 5-3 and easily closed out the match on his serve.

"I just felt good today, felt I was hitting the ball well," Edmund said. "I just knew that if I put myself in the match hopefully in the closing stages I would give myself a chance. That game in the third set was very key. When Novak gets a lead it's very hard to break him down because he becomes a bit more aggressive."

Edmund will next play eighth-seeded David Goffin, who defeated Robin Haase 7-5, 6-3.

Nadal improved to 17-1 overall on the season with his win over the 41st-ranked Monfils.

"I'm happy to start with a victory," said Nadal, whose last loss on the dirt came against Dominic Thiem in Rome last year. "It was a very solid match in all aspects."

Nadal, who is two sets away from breaking John McEnroe's 1984 record of 49 straight sets won on a single surface, will next face Diego Schwartzman, who defeated Feliciano Lopez 7-5, 2-6, 6-2. The 36-year-old Lopez will be the tournament director in Madrid beginning next year.

Seventh-seeded John Isner beat fellow American Ryan Harrison 7-6 (1), 7-6 (7), while eighth-ranked Kevin Anderson defeated qualifier Mikhail Kukushkin 5-7, 7-6 (3), 6-2 to set up a third-round match against Philipp Kohlschreiber, who beat Roberto Bautista Agut 6-3, 4-6, 7-5.

Maria Sharapova made it to the quarterfinals for the first time since January with a 6-3, 6-4 win over Kristina Mladenovic.

Sharapova will face 20th-ranked Kiki Bertens, who ended Caroline Wozniacki's bid to return to the top of the rankings with a 6-2, 6-2 win.

"I just felt like I did the right things," Sharapova said. "Despite a slow start, I was still very positive."

The second-ranked Wozniacki needed to win the title in Madrid to overcome Simona Halep for the No. 1 spot.

Halep beat Kristyna Pliskova 6-1, 6-4 to stay on track for a third straight title in Madrid. She will face her opponent's sister, sixth-seeded Karolina Pliskova, who defeated Sloane Stephens 6-2, 6-3.

"At this tournament it's really nice that I know I can play my best tennis," Halep said.

Third-seeded Garbine Muguruza was upset by 20-year-old Daria Kasatkina 6-2, 4-6, 6-3, while Carla Suarez Navarro eliminated Bernarda Pera 2-6, 6-2, 6-4.

_

More AP tennis coverage: https://apnews.com/tag/apf-Tennis

_

Tales Azzoni on Twitter: http://twitter.com/tazzoni