The No.13-seeded Ivanovic came out firing, winning the first three games of the match and eventually taking the first set, 6-4, and she even got a sniff in the next two sets, getting to 2-all in the second set and 3-all in the third set. But the No.2-seeded Azarenka stayed close with her every time and pulled away just enough down the home stretch, finishing it off after two hours and 10 minutes, 46 63 64.
There were some tense moments at the end, as Azarenka missed backhands on her first two match points at 5-3 in the third set and Ivanovic blasted an inside out forehand winner on her third match point at 5-4 in the third, but one last backhand into the net from Ivanovic on the fourth sealed the deal.
"It was a big battle, and that's what I was expecting from Ana," Azarenka said. "She's playing much, much better right now. She came out firing with a lot of great shots and served really well. She was definitely going for everything. It didn't leave me much room to go for my shots - but I started to create more opportunities for myself, and in the end of the first set it was already turning around."
Ivanovic was happy with some things in the match and a little bit frustrated with other things.
"I came out feeling good today," Ivanovic said. "I was playing well and putting her under a lot of pressure, but I think the biggest difference was the serve in the second set. My percentage went right down. I felt like I could break her, but it was very frustrating that I was losing my serve constantly. She definitely played well though, and she came up with good serves in the big points during the match.
"I really tried to stick with the game plan and keep pushing her, but at the end it went to her."
At the end of it all, though, Ivanovic only took the positives away. "For me it's frustrating that I had opportunities today and didn't take them, but it was still a very, very close match. And that's very encouraging, because I know I'm right there with them. She's a top player. She just came from winning Cincinnati. So there are definitely a lot of positives to take away from this week and this match.
"But it still doesn't change the fact that it's disappointing and it hurts."
Next up for Azarenka is Daniela Hantuchova, who won her fourth round match on Monday. Azarenka and Hantuchova are tied in their head-to-head series, 2-2. Azarenka has won their last two meetings.
"Daniela is playing incredible tennis right now, really going so deep in the tournament," Azarenka said. "She's a player who has been in these situations before with a lot of experience, and she has a lot of motivation right now. She's also a shot maker. It's going to be another tough battle of just trying to take your chances, playing your game and trying to be in control as much as possible out there."