(CNN) -- Serena Williams captured her first title in over a year as she breezed past Marion Bartoli in the Stanford Classic in California.
The 13-time major champion was twice a break down in the opening set but battled back to take the game 7-5 6-1 in one hour and 22 minutes.
A foot injury and then a blood clot in her lungs kept Williams out of action for almost a year but her 38th title win means she is in good shape with the U.S. Open approaching.
After her win she said: "I'm shocked. I loved the support -- it's been so cool, so awesome. I'm so happy to be back."
Asked what was going through her mind as Bartoli served for the first set she said: "She has a really good serve and is such a good player so I was thinking 'No matter what, I got this far and I may as well try to relax.'"
Williams gained revenge for her fourth-round defeat at the hands of Bartoli at Wimbledon but struggled in the early stages.
Bartoli, the third seed, was serving for the set at 5-4 but Williams broke back and went on to take the set.
She then won the first five games of the second set before Bartoli finally got a game on the board. But it was only a temporary reprieve as Williams held serve to take the match.