MADRID, Spain -- No.14 seed Daria Kasatkina of Russia pulled off an upset over No.3 seed and Spanish favorite Garbiñe Muguruza in the third round of the Mutua Madrid Open on Wednesday night, claiming a hard-fought victory by the scoreline of 6-2, 4-6, 6-3.

"I was playing against No.3 in the world, and it’s always giving you confidence when you’re beating big players on the big stages," Kasatkina told the media afterwards, reflecting upon her fourth win over a Top 3 player this year. "Matches like this, when you’re fighting for every ball -- of course after these matches, you’re feeling much better."

Kasatkina picked up her second lengthy win over Muguruza this year, following her two-and-a-half-hour marathon semifinal victory in Dubai this winter, as the Russian moved into the Madrid quarterfinals in two hours and 28 minutes.

"I knew it was going to be a different match completely because she was playing at home, we are playing on the clay," Kasatkina continued. "I was not even thinking about Dubai, because it was a completely different story."

Kasatkina won 64 percent of points on her first serve in the match, while Muguruza won slightly less than half on her first delivery, leading to six breaks of her serve. Kasatkina had 20 winners to 36 unforced errors, while Muguruza's 32 winners were half of her unforced error count of 64.

Kasatkina will now square off against No.10 seed Petra Kvitova of the Czech Republic in the elite eight, after Kvitova’s challenging three-set victory over Estonian Anett Kontaveit earlier on Wednesday.

At the start of the match, Kasatkina took an opening set which hardly predicted the protracted battle to come. The Russian began the set by fending off two break points to hold for 2-1, before Muguruza erased three break points of her own to level the score at 2-2.

From there, Kasatkina dominated the set, connecting on sterling service returns to pick up a break and lead 4-2, and striking penetrating forehands to reach double set point on Muguruza’s serve two games later.

Muguruza sent a backhand awry on Kasatkina’s first set point to cede the opening frame to the Russian -- one of 20 unforced errors by the Spaniard in the first set, with only six winners to show for it. Kasatkina also had 11 unforced errors, more than her eight winners, but was effective on first serve, winning 79 percent of those points.

Muguruza hoped to mount a furious comeback for the second straight match, as she had dropped a 2-6 set to Donna Vekic before turning that match around in the previous round. The Spaniard broke Kasatkina with a backhand crosscourt winner to lead 1-0, and held at love for 2-0 to keep her in the mix.

But Kasatkina reeled off four straight games behind her heavy spin and wily all-court play, epitomized by breaking for 4-2 after an inch-perfect lob sailed beyond Muguruza for a winner. 

The tables turned, however, when Muguruza got back on serve in the next game, then held for 4-4 behind two forehand winners mid-game which each barely clipped the baseline. Kasatkina became frustrated due to those close calls, and suddenly, the Russian found herself staring down a third set after Muguruza broke for a 5-4 lead with a solid backhand forcing an error.

Muguruza became embroiled in a long game when serving for the second set, losing her first set point with a double fault, and hitting a backhand error into the net to give Kasatkina break point. But the reigning Wimbledon champion held her ground, and on her third set point, Muguruza won a furious rally with a forehand down the line to seal the set.

Anything seemed possible at the start of the deciding set, but once more, Kasatkina grasped an early break advantage, jumping ahead to 3-1 after Muguruza started to regularly misfire on her backhand. An easy hold bolstered by some keen hitting off the forehand side put the Russian at 4-1, two games away from her fourth win of the season over a Top 3 player.

The next game was fascinating, as Muguruza had to survive a 20-minute tussle to keep herself within one break of the Russian. Kasatkina held eight break points in the game, but Muguruza repelled all of them, mainly by serving pristinely or slamming big groundstrokes to take command of the rallies. On her fifth game point, Muguruza finally held for 2-4 when a Kasatkina forehand went wide.

"I felt like every time I had a break point, she was serving unbelievably," said Kasatkina, who admitted she had never played a game like this in her professional career. "That’s the only thing I felt, because her fighting’s so good. It was not like some mistakes on the deuces or break points, we were fighting for every ball, and it was really tough."

Kasatkina stumbled after that battle, quickly dropping serve in a game which featured three unforced errors off the Russian’s backhand. Muguruza was back on serve at 4-3, and it was possible that the 20-minute game could have become a massive turning point in the match.

Kasatkina, however, had other ideas, probing Muguruza with her forehand in the next game, and the Spaniard gave up two straight errors off her backhand to hand over the break and a 5-3 lead. Kasatkina faced one break point when serving for the match, but Muguruza sent a service return long on that point, and two points later, the match ended with a victorious Kasatkina roaring in delight.

Meanwhile, Muguruza was reflective during her post-match press conference. "I am disappointed, but in comparison with other years that I felt in Madrid, this year I'm very happy because I feel like I really gave everything I had over there," said Muguruza, who, despite the loss, posted her best career performance in Madrid this year. "I felt good. It's just that Kasatkina played better today."