World number one Victoria Azarenka has remained in the BNP Indian Wells Open by the skin of her teeth with a 6-4 6-7 7-6 win over Mona Barthel.
Azarenka served imperiously in the opening set and claimed the solitary break in game seven before comfortably holding to 15 in game 10.
The Belarusian then stormed into a 5-1 lead at the start of the second and looked to be on her way to a third consecutive career victory over the 21-year-old German, before Barthel, with some inspired baseline hitting, battled back to take the set 7-4 in a tie-break.
Barthel broke in the opening game of the final set and then held to deuce on her way to a 4-1 lead.
Azarenka fought back to level at 5-5 but she was again broken in a mammoth deuce-fest, leaving the world number 37 to serve for the match.
The German could not keep her nerve and, after Azarenka had easily broken back to 15, the world number one claimed the deciding set 8-6 in the tie-break.