Japan's Kei Nishikori and Naomi Osaka both came from behind to reach the Australian Open quarterfinals on Monday, Nishikori needing five sets and over five hours to outlast Spaniard Pablo Carreno Busta.

Nishikori made 67 unforced errors in the 5-hour, 5-minute marathon, but the eighth seed came out on top 6-7(8), 4-6, 7-6(4), 6-4, 7-6(8) over the 23rd-seeded Carreno Busta, who blew an 8-5 lead in the final tiebreak.

Nishikori's win sets up a quarterfinal against top seed Novak Djokovic. Nishikori has not beaten the Serb since the semifinals of the 2014 U.S. Open and is 2-15 against him in his career.

Earlier in the day, Osaka conceded the opening set for the second straight match, but mounted a successful comeback against Latvia's Anastasija Sevastova and reached the quarterfinals here for the first time in four attempts.

The fourth-seeded Osaka overcame her opponent's skillful net game and her own error-riddled play to claim a 4-6, 6-3, 6-4 victory at Rod Laver Arena and set up a quarterfinal match against Ukrainian Elina Svitolina, the sixth seed.

Nishikori's night match, his first career meeting with Carreno Busta, proved to be an epic.

"I feel like I'm holding up. Today was the toughest match," Nishikori said. "I just didn't know how to break back. I'm going to try and recover well tomorrow."

Nishikori looked the better player in the 1 hour, 16 minute first set, racking up eight break points but converting just two. He missed some open shots and on a few others he had winners only to set Carreno Busta up for a better shot.

In the second set, Nishikori was broken in the second game and lost the next point off his serve on a backhand error. He threw his racket to the court in a rare display of frustration.

But after falling down by two sets, he began to look more at home on the court. Although his shots lacked some of their normal zip, Nishikori looked confident again. After winning the tiebreak, he broke Carreno Busta to open the fourth set and won a love service game to clinch the set.

Nishikori upped his game in the fifth set and appeared to have Carreno Busta on the ropes with a series of superb drops and winners, but the Spaniard battled back and broke Nishikori in the 10th game to set the stage for the match's third tiebreak.

"The third and fourth sets I started playing better, and in the fifth set I think we both played good tennis," Nishikori said.

Osaka became the first Japanese woman to reach the best eight at the first Grand Slam of the year since Ai Sugiyama in 2000.

"(I'm most happy about) just the fact that I didn't gave up," Osaka said. "She was playing really well and I wasn't really sure what to do at a certain point, but I just tried to stick in there."

The pair had split their four previous match-ups.

Osaka said she was no stranger to being made to work for a win at this year's tournament, having survived a scare against Taiwan's Hsieh Su-wei in the third round on Saturday.

"I was thinking I'd been in this position before, and actually last time was a little bit worse," she said.

Osaka gave up her serve early on and allowed the 28-year-old Sevastova to take a two-game lead, committing 17 of her 43 total unforced errors in the first set.

The 21-year-old regained her composure in the second set, though, and broke her opponent while going up 5-2. She was nearly broken back in the ninth game and bounced a ball high into the air in her frustration, but came out the victor of a 23-shot rally and served out the set.

Reinvigorated, Osaka immediately took advantage of a break point opportunity in the third set. But after giving up three straight points, she let Sevastova equalize despite rallying back from 40-love, throwing her racket down in disappointment after losing the game on the Latvian's third advantage.

But after taking another break point, Osaka dug in and finished out the match, surviving a nail-biting eighth game and clinching the victory with her 51st winner to book her spot in the quarterfinals.

After the match, Osaka said she had been inspired by performances from peers like 21-year-old Frances Tiafoe and 20-year-old Stefanos Tsitsipas, who upset No. 3 Roger Federer in the fourth round of the men's singles on Sunday.

"I was watching all these kids winning last night -- Tsitsipas beat Federer and I was like 'Whoa'. So I decided that I wanted to do well, too," she said.

"I thought they were playing really well, and just the fact that they came out here and played against some of the top players and won -- I also want to do that. I think that's everyone's dream."

Osaka has only reached the quarterfinals of a major once before in her career. She accomplished the feat for the first time last year during her championship run at the U.S. Open, where she became the first player of Japanese or Haitian descent to win a Grand Slam.

She is looking to become the 10th woman in history to win the U.S. Open and Australian Open back-to-back.