Djokovic and Philipp Kohlschreiber resumed their third-round match that was suspended because of rain a night earlier. The unseeded German knocked off the five-time tournament champion 6-4, 6-4.
Osaka lost to Belinda Bencic 6-3, 6-1 in just over an hour in the fourth round of the first title defense of her career.
"She sort of came out there really aggressive,'' Osaka said. "She sort of knew what she wanted to do more than me.''
Since Osaka took the title at Indian Wells a year ago, she has won the US Open and Australian Open. Her triumph in Australia made her No. 1 for the first time, but her time at the top has been rocky. Osaka fired her coach and lost in the first round in Dubai before taking on a new coach, Jermaine Jenkins, who came on court during Tuesday's match.
"It's always a bit tricky whenever you change someone in the team, but I feel like for a first tournament we did really well,'' Osaka said. "We communicate well, so I think that's a really big plus. I don't think it's going to be difficult.''
On Tuesday, the 23rd-ranked Bencic served and returned better.
Nadal eased by 25th-seeded Diego Schwartzman 6-3, 6-1, while Federer defeated Swiss countryman Stan Wawrinka 6-3, 6-4.
"Overall, it's not been easy playing Stan,'' Federer said. "He feels the same way, so that's very awkward sometimes.''
Djokovic owned an 8-1 record against Kohlschreiber, who beat a No. 1 player for the first time.
Kohlschreiber liked the weather -- sunshine and temperatures in the low 70s -- much better than the cold and rain on Tuesday night.
"I liked my chances more at night against Kohlschreiber, but it wasn't to be last night,'' Djokovic said. "Completely different conditions today. I congratulate him for playing tactically really well and getting me out of my comfort zone. He deserved to win.''
The 35-year-old Kohlschreiber started thinking he had a chance early in the first set after surviving a handful of break points on his serve.
"I would say after 3-all in the first set I felt like getting closer to the set, holding my service games, which is not easy against Novak, because he's such a great returner,'' Kohlschreiber said. "I know from that point on it's going to be a very interesting match.''
Djokovic was just 1-for-5 on break-point opportunities. Kohlschreiber converted three of his four chances.
Next up for Kohlschreiber is Gael Monfils, who owns a 13-2 record against the German.
Djokovic remains alive in doubles with partner Fabio Fognini. Djokovic returned about an hour after his singles loss for their match.
"When I hit a good return, I was wondering why this didn't happen in singles,'' Djokovic said.
"I haven't played that much, so I wanted to make it count,'' said Williams, who expects to play about 12 tournaments this year. "I need to do what I want, and what I want is to play the tournaments I want to play.''