(CNN) -- A "sleeping" Victoria Azarenka woke up in time to beat Ana Ivanovic at the U.S. Open and keep alive her chances of reaching a fourth consecutive hard-court grand slam final.
Azarenka dropped the first set against the former world No. 1 and struggled to put the Serbian away but eventually prevailed 4-6 6-3 6-4 in a hard-hitting fourth-round encounter that was pushed back to Tuesday because of rain.
It was the second straight match the world No. 2 -- she, too, is a former No. 1 -- needed to stage a comeback following a sluggish start. France's Alize Cornet won their tiebreak in the first set in the third round.
Men's No. 1 Novak Djokovic had no such troubles, routing Spaniard Marcel Granollers in about one hour, 20 minutes.
Azarenka struck a mere four winners in the first set against Ivanovic, combined with nine unforced errors. Ivanovic certainly wasn't asleep, crushing 17 winners.
"Ana came out firing and played amazing in the first set, and I felt like I was a little out of place," Azarenka said in an interview on court. "I was sleeping but she was ripping winners and serving great so I really had to wake up in the second set and fight for the points.
"In the second set I was more determined, more focused and taking the opportunities."
Her numbers weren't that much better in the second set but Ivanovic cooled thanks in part to Azarenka changing the pace at times with a drop shot.
In a seesaw third set -- there were four straight breaks at one stage -- Azarenka blew two match points serving at 5-3 only to be let off the hook when Ivanovic dumped a backhand on a fourth match point.
Although Ivanovic put up a brave fight, she ultimately slumped to 3-20 against top-two opposition.
"The match points were pretty bad," Azarenka, who lost last year's final to Serena Williams, said. "I didn't really go for my shots. I kept waiting for a mistake. It didn't happen.
"She played really great. Especially in the tough moments I felt she was raising her game. I had to stay tough as well."
Azarenka meets pal Daniela Hantuchova in the quarterfinals having captured two of their four previous encounters. Three of the matches have gone the distance.
Former French Open winner Li Na of China achieved a first U.S. Open semifinal by overcoming tricky Russian Ekaterina Makarova 6-4 6-7 6-2 and there was more drama in the men's fourth round as Russia's Mikhail Youzhny outlasted fellow veteran Lleyton Hewitt of Australia.
Youzhny, previously a semifinalist in New York, upended the 2001 champion 6-3 3-6 6-7 6-4 7-5 in four hours.
Having blown a 5-2 lead in the fourth, Hewitt broke Youzhny to get back on serve in the fifth. Youzhny subsequently broke at 5-5 and served out the match.
Youzhny next confronts Djokovic, a 6-3 6-0 6-0 winner over a seemingly weakened Granollers. Granollers' first three matches went to five sets and he also played doubles in New York.