Milos Raonic came back from an early deficit to defeat Russia’s Alexander Zverev 4-6, 7-5, 4-6, 7-5, 6-1 in a three-hour thriller on Monday, setting him up for a quarterfinal meeting with third-seed and seven-time Wimbledon champion Roger Federer.

The Canadian got in early trouble against the tournament’s 10th seed when he was broken in the third game of the opening set.

Canada’s Milos Raonic returns to Germany’s Alexander Zverev during their Men’s Singles Match on day seven at the Wimbledon Tennis Championships in London Monday, July 10, 2017. (AP Photo/Alastair Grant)

The second set didn’t start any better for the Thornhill, Ontario product, who was broken in the first game. But, Raonic was able to get that break back in the sixth game to even out the set 3-3. They stayed on serve until Raonic led 6-5 and then broke Zverev again to take the set.

They were on serve in the third set until the seventh game when Raonic was broken on a missed forehand volley. This error allowed Zverev to take the lead and close out the set.

Down two sets to one, Raonic was seemingly on the ropes.

Canada’s Milos Raonic serves to Germany’s Alexander Zverev during their Men’s Singles Match on day seven at the Wimbledon Tennis Championships in London Monday, July 10, 2017. (AP Photo/Alastair Grant)

But the fourth set was a back-and-forth battle as Raonic and Zverev stayed on serve until the very end. With Raonic up 6-5 and Zverev serving, the German made an unforced forehand error to give Raonic life as the match was now even.

The break to win that fourth set seemed to give Raonic the boost he needed as he dominated his opponent in the deciding set. He closed out the game with his 23rd ace of the match.

Canada’s Milos Raonic celebrates after beating Germany’s Alexander Zverev in their Men’s Singles Match on day seven at the Wimbledon Tennis Championships in London Monday, July 10, 2017. (AP Photo/Alastair Grant)

This win sealed the 26-year-old’s spot in the quarterfinals on Wednesday against Federer. Raonic’s last meeting with the Swiss star was at last year’s Wimbledon semifinals where Raonic earned himself a spot in the final round. Federer holds the all-time advantage with nine wins in their 12 meetings.

This will be Raonic’s seventh appearance in a Grand Slam quarterfinal.