(CNN) -- Marion Bartoli of France upset hot favorite Venus Williams 6-2 5-7 6-4 to win the WTA tournament at Stanford in California.
Venus Williams suffered a final disappointment at the hands of Marion Bartoli.
It was the fifth tour title for Bartoli, who was beaten by Williams in the Wimbledon final in 2007.
Bartoli, who was seeded eighth, took advantage of a lackluster display from Williams and led 6-2 5-3 before the second seed burst into life to win the next four games and level at one set all.
But Bartoli, who lost in last year's final to Aleksandra Wozniak, dug in to break the American in the first game of the decider and hung on for the victory after two hours and 43 minutes.
It was her fifth WTA Tour title and almost certainly the sweetest.
"It was so hard to win the last game," she told the official WTA Tour Web site www.wtatour.com.
"The only chance to win that was to take my chances, because otherwise Venus wouldn't give me anything. I gave everything I had today."
Williams, a two-time winner at Stanford, was also generous in defeat.
"Marion played really well today. I have to give her credit for playing so well," she said.
"I was fighting myself out there as well as her. It was a tough day. I had to fight through it and in the end I ran out of time. My last few matches were so good, but today I just couldn't execute the way I wanted."
Defeat completed a miserable week for the Williams sisters, with top seed Serena crashing out to Australian Samantha Stosur in the quarterfinals.
Bartoli had to battle past Stosur in a three-setter in the last four to earn a final clash with Williams, who had brushed aside Elena Dementieva of Russia.