Caroline Wozniacki beat Maria Sharapova 7-6 (7-4) 6-7 (5-7) 6-2 in a marathon match at the WTA Finals in Singapore.
Both players were broken twice in a gripping first set, which went to a tie-break, won by Wozniacki.
The Dane served for the match at 5-4 up in the second - but was broken and lost the set on another tie-break.
In the decider, Wozniacki was the dominant force as she won four games in a row from 2-2 to earn victory in three hours and 14 minutes.
|WTA finals at a glance|
|The end-of-season competition features the top eight ranked players in the world. Two sets of four players face each other in round-robin matches, before the top two in each group advance to the semi-finals.|
"I'm feeling a little tired," said Wozniacki. "In the third set, I stepped it up and started hitting through the ball a bit more."
In the following match, on court after 23:00 local time, Wimbledon champion Petra Kvitova lost 6-2 6-3 to Agnieszka Radwanska.
Wozniacki had beaten her Russian rival at the US Open earlier this year and their latest contest provided plenty of drama and twists.
Sharapova came back from 3-0 down in the first set to level and broke her rival in the ninth game to take a 5-4 lead.
But, serving for the first set, Sharapova opened up with the first of two double faults in the game as Wozniacki levelled and held her own serve to go 6-5 in front.
Two more double faults from the Russian in her next game gave Wozniacki a set point - only for Sharapova to find the line with a powerful forehand before the set went to a tie-break.
Wozniacki trailed 4-2 but recovered to lead 6-4 and took the set when Sharapova served her ninth double fault.
A problem with the lights in the second set caused problems for Wozniacki but she manoeuvred her way to a 5-4 lead only to be broken when serving for the match.
Another tie-break was needed and this time Sharapova came out on top to level.
In the deciding set, eighth seed Wozniacki's perseverance and pressure finally helped her pull clear for a hard-earned a hard-fought win over the world number two.