Madison Keys rallied from first and third-set deficits to defeat Coco Gauff in the fourth round of the Mututa Madrid Open on Monday 7-6(4), 4-6, 6-4 to reach the quarterfinals at the Caja Mágica for the first time in her career. 

Keys trailed 5-2 in the first set and 4-2 in the final set, but rallied in 2 hours and 30 minutes to defeat Gauff for the third time in five career meetings. The elder of the two Americans now owns a win over Gauff on hard courts, clay and grass -- and she's the first American not named Jessica Pegula to beat Gauff since Sofia Kenin in the first round of Wimbledon last summer. 

Gauff had won five previous matches against compatriots this year.

A new milestone for Keys: The 2017 US Open finalist entered Madrid having lost in the first round in seven of her nine previous trips to Madrid, but a quarterfinal showing this year betters her previous best, which was a third-round showing in 2016.

In addition, Keys -- who missed the Australian Open due to injury -- hadn't won three matches in a row since reaching the US Open semifinals last summer. She last reached a clay-court WTA 1000 quarterfinal eight years ago, when she went all the way to the final at the Internazionali BNL d'Italia. That was also the year she scored her last Top 10 win on the surface.

How the match was won: Both players had ample opportunities in each other's service games in the match, as they combined for 29 break point chances. Each woman broke seven times, but Gauff's 13 total double faults -- nearly a third of her 38 unforced errors in the match -- helped set Keys up for many of her opportunities. 

Gauff, in fact, won four more points overall than Keys in match -- 115 to 111. 

"I definitely had to stay tough," Keys said afterwards. "Being able to just stay calm and trust myself, and get myself out of tough sets was really important. I was just trying to take the opportunities when they presented themselves."

Up next: Keys will next face former Madrid champion Ons Jabeur, the No.8 seed, for a spot in her sixth career WTA 1000 semifinal. Jabeur is 2-0 against Keys all time and hasn't lost a set, but both of their previous matches have come on hard courts.