Williams cruised through the first set in windy conditions before the hard-hitting Shvedova found her rhythm in the second, breaking the American twice to level the match.
Williams then wasted three break points at 4-4 in the third before eventually breaking for a 6-5 lead. She clinched the victory with a backhand winner on her first match point.
In her third-round match, Williams won the last set 9-7 against Zheng Jie.
Shvedova, a wild-card entry, became the first woman in the Open Era to win a set without losing a single point in her third-round match against Sara Errani.