The top-seeded American had won all seven of her previous encounters against the 18th-ranked Kirilenko but was forced to dig deep on many occasions to ensure her eighth victory over the Russian would be completed in straight sets.
Kirilenko secured the first break of the match in the ninth game and had three set points on her serve in the next but Williams rallied to break back before sealing the set after her opponent double faulted.
"I just thought, 'what else can I do except fight for this point and the next point,'" Williams told the WTA website of the prospect of losing the first set.
"Maybe I got lucky a little bit - I just started to relax and kind of swing and not think about it too much out there. I'm obviously just really happy to get through this match today."
Williams fell behind again in the second set after being broken in the fifth game but the 17-time Grand Slam singles winner, who has won more than $9 million (£5.5 million) in prize money in 2013, rallied again to close out the set and the match.
Caroline Wozniacki set up a quarter-final encounter with Williams after she outlasted the American Sloane Stephens 6-3 6-1.
Earlier, eighth seeded Serb Jelena Jankovic dished up a double bagel 6-0 6-0 beating of Spaniard Carla Suarez Navarro to also advance to the last eight.