Maria Sharapova gained revenge over the Latvian 16th seed Anastasija Sevastova with a gutsy 7-6 (7/3), 5-7, 7-6 (9/7) victory in the China Open first round on Saturday.
It was the five-time Grand Slam winner's first appearance since she was beaten by Sevastova at the US Open in early September and gets her stop-start return from a doping ban back on track.
Sharapova, ranked 104 in the world, is a wildcard in Beijing as she works her way back slowly from a 15-month ban for taking the banned substance meldonium.
She was far from her best, but Sharapova dug in during an attritional match lasting more than three hours.
Sevastova broke the Russian former number one -- who had the majority of the crowd behind her -- in the seventh game of the first set to seize the early initiative.
Sharapova immediately broke back for 4-4, before falling 6-5 down on her own serve when her drop shot went astray, only to strike back immediately to force a tie break.
"Come on!" the former China Open champion Sharapova shouted as she wrapped up the first-set tie break.
The 30-year-old looked set to race through the second set to book her place in round two.
But her serve was suspect all match and the Latvian refused to submit.
Sevastova broke Sharapova once more as the match clock hit the two-hour mark to level the encounter at one-set each, before Sharapova finally saw off her resilient opponent in an epic decider.
Earlier, the second seed Simona Halep battled past the American Alison Riske in three sets, 6-3, 3-6, 6-2.