The top-seeded defending champion will next face France’s Caroline Garcia after dispatching her Kazak rival in one hour, 45 minutes.
“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.
Australian veteran Lleyton Hewitt captured his 600th career victory while countryman Bernard Tomic became the fastest loser in ATP history.
Former number one Hewitt rallied to defeat Dutchman Robin Haase 2-6, 6-3, 6-3 to reach the second round while Tomic fell in his first match since January hip surgery 6-0, 6-1 to Finland’s Jarkko Nieminen.
Tomic, ranked 74th, crashed out in 28 minutes, 20 seconds, believed to be the ATP’s shortest match by a minute. Tomic was playing for the first time since a retirement against Rafael Nadal in a first-round match at the Australian Open.
Hewitt, 33, turned in another of the trademark fighbacks which have characterized a career that included Grand Slam crowns at Wimbledon in 2002 and the US Open in 2001.
The 44th-ranked Australian reversed course in the second set to reach the second round in just under two hours, with Haase saving a match point before exiting.
“It’s not something you focus on, to tell you the truth. I totally forgot,” Hewitt said of his 600th triumph. “Today was just like another match and an opportunity to go out there and play well.
“Obviously afterwards, it’s a great milestone. Not many people get to achieve that. Not many people get the opportunity to get close to that, so it means I’ve been around for an awfully long time as well. I’m getting old.
“A few years ago when I had the last couple lot of surgeries I probably would have doubted I’d get to this stage anyway. I’m still grateful I’m out there and able to compete with the best guys.”