MELBOURNE, Australia — It started badly for Novak Djokovic, who needed 24 serves, six break-point saves and 15 minutes just to hold his first game in the second round.

This was not the close-to-invincible Djokovic that fans were used to seeing at the Australian Open, where he has won a record-equaling six titles, including five in the previous six years.

In his earliest loss at a Grand Slam tournament since 2008, the second-seeded Djokovic lost 7-6 (8), 5-7, 2-6, 7-6 (5), 6-4 Thursday to No. 117-ranked Denis Istomin, a wild-card entry from Uzbekistan.

“All the credit to Denis for playing amazing. He deserves to win,” Djokovic said of their four-hour, 48-minute match. “He was the better player in the clutch moments.

“Obviously, I was not pleased with my performance overall, but I have to congratulate my opponent. Whenever he needed, he came up with a big serve, big play.”

Djokovic hadn't dropped a set to Istomin in six previous matches. But he lost the 85-minute first set in a tiebreaker and then seemed to get the momentum back, only for Istomin to finish stronger.

Istomin's only previous win in 33 matches against top-10 players was in 2012 versus then-No. 5 David Ferrer.

“It is the biggest win for me. It means so much,” Istomin said. “Now I feel I can play with these guys, and to be with them on the same level.”

Serena Williams, who like Djokovic was ranked No. 2 and is a six-time Australian Open champion, kept her chase for an Open-era record 23rd major title on track with a 6-3, 6-4 win over Lucie Safarova.

After winning a rematch of the 2015 French Open final against Safarova, Williams will play fellow American Nicole Gibbs in the third round.

“It's never easy to play in the second round someone you've seen in the final of the biggest stage in tennis,” Williams said. “I'm happy to have gotten through it.”

Third-ranked Agnieszka Radwanska lost her second-round match to Mirjana Lucic-Baroni 6-3, 6-2.