Victoria Azarenka of Belarus got a measure of revenge in the bett1open quarterfinals on Friday, as she outlasted Jessica Pegula of the United States, 6-2, 5-7, 6-4.

"I'm really happy that I made it out in the third set," Azarenka said, after her win. "I played really well in the beginning of the match, the first set and in the middle of the second set. Then she went for a couple of shots, and I felt like I slowed down and was doing too much of repeating the same mistakes. But I'm glad that I was able to turn it around."

No.7 seed Azarenka lost to Pegula in the first round of the Australian Open earlier this season, in their first encounter. But in the rematch, it was the former World No.1 who prevailed in an hour and 49 minutes, clinching a spot in her second semifinal of the season.

As darkness fell in Berlin, Azarenka gritted out a tough win over the World No.26, converting six of her nine break points and winning just over half the points returning the Pegula second service.

An opening set of aggressive-minded returning by Azarenka started with a love break in the first game of the match. The Belarusian continued on from there, claiming an insurance break to lead 5-2 before she served out the set impeccably at love. Azarenka did not face a break point in the first set.

Azarenka’s momentum extended into the second set as she broke service in the first game once again, and powered her way to a 4-2 lead. But a double fault by Azarenka on break point at 4-3 allowed Pegula her first break of the day, and the American took advantage to inch ahead in the set.

At 6-5, Pegula took her chance, following a forehand winner for 30-30 with an error-forcing backhand to line up a set point. Azarenka fired a forehand into the net at that juncture, and Pegula had suddenly leveled the match from a set and a break down.

"Matches on grass can go fast, one or two breaks and it's already more difficult," Azarenka said.

Four straight service breaks opened the decider, but Azarenka took the lead for good after aggressive forays into the forecourt set up triple break point at 3-3, culminating in a double fault by Pegula to drop serve.

Azarenka would not be denied even as dusk settled in, and the No.7 seed picked off a winner on her second match point to beat sunset and move into the semifinals, where she will now face Russian qualifier Liudmila Samsonova.

Azarenka outlasts Pegula in Berlin quarterfinals: Highlights

Earlier on Friday afternoon, Samsonova continued her stellar run out of qualifying as this week's surprise package defeated Madison Keys of the United States, 7-6(4), 2-6, 7-6(0).

It was the third straight match of the day to be decided by a final-set tiebreak, and this time it was Samsonova who overcame former Top 10 player Keys, booking a spot in the second WTA singles semifinal of her career, and her first at WTA 500-level or higher.

Read more: Cornet, Bencic edge Muguruza, Alexandrova in deciding tiebreaks to set Berlin clash

World No.106 Samsonova has earned her first three main-draw grass-court wins at tour-level this week, all of which have come over Top 50 players. Samsonova defeated Marketa Vondrousova in the first round and Veronika Kudermetova in the second round.

Samsonova needed two hours and 24 minutes to notch one of her biggest career wins yet, winning 83 percent of points off of her overwhelming first serve to pull through a number of tough holds, eventually eking out the win after a commanding third-set tiebreak.

A stellar serving display by both players in the opening set was interrupted by a single exchange of breaks. Keys moved ahead 4-2 with a backhand winner on break point, but Samsonova broke back in the very next game.

Both players cruised on serve from there into the tiebreak. Keys led 4-2 in the breaker, but Samsonova went on a run of points, and one of her forehands dribbled over the netcord to set up a 6-4 lead. Samsonova claimed the next point after a Keys forehand went long, and the first set went to the Russian.

The second set, though, was handily won by Keys. The former US Open finalist forced errors with powerful groundstrokes from both sides en route to a 4-0 lead, and Keys served her way through the rest of the set to level the affair.

Both players held throughout the final set, but not without struggles. Samsonova had to save four break points in the first game, while Keys needed to fend off five before holding for 3-3. At 5-5, Keys again had four break points, and converting any one of those would have let her serve for the match at 6-5.

But Samsonova held firm and another final-set tiebreak began. Critical errors by Keys on her first two service points ceded a 3-0 lead to Samsonova, and the Russian took advantage, blasting incredible unreturned serves to reach 5-0. As it turned out, Samsonova raced through the breaker, collecting a key victory with an error-forcing forehand on her first match point.