The top-seeded defending champion will next face France's Caroline Garcia after dispatching her Kazak rival in one hour, 45 minutes. (Agencies)
"The first set was really tough. She can make you play. She was hitting the ball well," Williams said. "I had to relax and try to keep my intensity and just try to get the win."
Williams lost a 3-1 lead and trailed 3-5 as Shvedova shifted her game up a gear.
Williams got back on track in the nick of time with a break for 5-all. A love game then ended with an ace for Williams before the set went to a tie-breaker.
In the decider, the 32-year-old Williams saved three set points as a nervous Shvedova missed her big upset chance in front of a screaming house full of her rival's supporters.
In one dramatic moment, a fight broke out in the upper deck of spectators, forcing a pause for security to intervene after Shvedova had double-faulted on her second set point.
After she also missed on a third, the Kazak handed over a set point to Williams, who finally finished off the 63-minute set on her second opportunity.
Williams tried to steady the second after a pair of breaks and finally won going away as she aced on her first match point to book a date with Garcia, who beat Czech Klara Zakopalova 7-6 (7/3), 7-6 (7/3).
"I'm just happy for another win," said a relieved Williams, who was playing for the first time in a month while healing back pain.
Fourth seed Maria Sharapova, the 2013 runner-up to Williams, outlasted Japan's Kurumi Nara 6-3, 6-4 in another testing opening match.
German Angelique Kerber, seeded fifth, beat China's Peng Shuai 6-3, 1-6, 7-6 (7/5) while 2011 Wimbledon winner Petra Kvitova, the number eight, defeated Argentine Paola Ormaechea 6-3, 6-4.
The top-seeded defending champion will next face France's Caroline Garcia after dispatching her Kazak rival in one hour, 45 minutes.