Emma Raducanu put in an impressive showing as she beat Beatriz Haddad Maia 6-1 2-6 6-4 in their third-round match at Indian Wells.
The British number one started strongly against the world number 13 and broke twice as she won the first set.
Raducanu dropped her serve twice as her Brazilian rival then levelled.
In the decider, Raducanu produced some brilliant tennis and broke Haddad Maia in the seventh game before keeping her nerve to serve out for the match.
Raducanu, who is 77 in the women's rankings, will play world number one Iga Swiatek or Bianca Andreescu in the last 16.
Raducanu only decided to play in this tournament 20 minutes before her first match amid illness and a recurring wrist injury, so will be buoyed by her progress and level of her tennis.
Having beaten Danka Kovinic and Magda Linette in the earlier rounds, she faced a tougher challenge against Haddad Maia but some aggressive play helped her to victory in two hours and 19 minutes.
It was Raducanu's first win against a top-20 player since she won the US Open in 2021.
"I am extremely happy with the way I fought and dug in in the third set," Raducanu told Amazon Prime.
"I dropped my intensity a bit in second and, against such a great opponent like Beatriz, that's enough and it's a 6-2 set before you know it. So, I was very happy with how I managed to regain my focus and intensity and come back in the third.
"For me its pretty amazing, I haven't really prepared for this tournament or practised, so to come out and play at this level and be competitive is a great sign for me."
Analysis
Russell Fuller, BBC tennis correspondent
It's quite a win. Who knows what's around the corner? When there have been brighter moments for Emma Raducanu over the last 18 months, they have been followed very swiftly by disappointment.
The thing to point out is that - other than a tournament in Seoul - that is the first time she has won three matches in a row since she won the US Open title.
Seoul in the fall of last year is a world away from doing it at Indian Wells, especially with so little preparation.
Whatever happens in the next match, this tournament has been a big success.