Agnieszka Radwanska recovered from losing her first set of the year and conjured up a rousing fightback to deny the courageous Anna-Lena Friedsam a first grand-slam quarter-final appearance at the Australian Open.
Friedsam had already moved into unchartered territory by reaching the fourth round of a major for the first time and the world number 82 was on the brink of the last eight when she served for the match, but Radwanska refused to be beaten.
The fourth seed fought back from 5-2 down in the final set at the Hisense Arena on Sunday to win 6-7 (6-8) 6-1 7-5 as a tearful Friedsam was troubled by a thigh injury and the Pole will now face either Carla Suarez Navarro or Daria Gavrilova in the quarter-finals.
Radwanska, eyeing her first grand-slam title, won just one point in the first two games of the match as 21-year-old German Friedsam carried on where she left off in her victory over Roberta Vinci.
The WTA Finals champion was in trouble at 4-1, but then reeled off five games in a row to take the upper hand for the first time, only for Friedsam to level at 5-5.
A resilient Friedsam saved three break points and forced a tie-break, in which there were seven mini-breaks - the last of which sealed the opening set for the outsider.
Radwanska, who was troubled by a leg injury in her third-round win over Monica Puig, made just two unforced errors in a one-sided second set and broke twice to level the match in quick time.
Friedsam was 2-0 down in the decider but won five games in a row to move within touching distance of a famous victory, only to find herself a break down when she was given a second code violation for taking too long to serve and Radwanska served out the match to complete a brilliant comeback.
Radwanska  bt Friedsam 6-7 (6-8) 6-1 7-5
Radwanska - 3
Friedsam - 4
Radwanska - 31/22
Friedsam - 42/61
BREAK POINTS WON
Radwanska - 7/16
Friedsam - 5/13
FIRST SERVE PERCENTAGE
Radwanska - 61
Friedsam - 64
PERCENTAGE OF POINTS WON ON FIRST/SECOND SERVE
Radwanska - 71/46
Friedsam - 52/41
Radwanska - 118
Friedsam - 91