Roger Federer, the world No. 3, rallied to beat Croatia's Borna Coric 2-6, 6-4, 7-6 (9-7) Thursday in the round of 16 at the Italian Open, where the Swiss great pulled off a monumental comeback in the third set tiebreaker on what is arguably not his best surface.

"The first set was really difficult, for me at least. I really struggled to see the ball. There was a lot of shade on the court and he did well, he's a very steady player. I couldn't chase the lines very well, so I couldn't hit any winners, but I really tried to play in a way where I was not going to just lose it. I gave him a chance to win, and he didn't, so I took it at the end," Federer said.

Coric had two match points in the tiebreaker, but he was unable to put Federer away.

"It was very tight. I got very lucky again today already like in Madrid. It's nice to get lucky I guess sometimes. I've lost a lot of heartbreakers throughout the years, so it's nice to win these and the atmosphere was fantastic. People were going crazy. It's exactly how you want the atmosphere to be," Federer said.

The 37-year-old Federer, who had not played in Rome since 2016, beat Portugal's Joao Sousa 6-4, 6-3 in a second round match earlier in the day.

Rain led to the cancellation of all matches on Wednesday, forcing Federer, who has avoided clay in recent years to avoid excessive wear-and-tear on his body and prolong his storied career, to win two matches in one day to advance to the quarterfinals.

The next opponent for Federer, who has won a record 20 Grand Slam singles titles, will be the winner of the match between rising Greek star Greek Stefanos Tsitsipas and Italy's Fabio Fognini.

The 22-year-old Coric broke Federer twice in the first set and jumped to a 4-0 lead just 20 minutes into the match at the Foro Italico, putting the set away 6-2 and appearing to be in command of the match.

Federer battled back in the tight second set, taking it 6-4 and sending the players to a decisive third set.

Coric, the world No. 15, and Federer played evenly in the third set, forcing a tiebreaker that the Croatian quickly took control of, going up 5-2.

With the crowd roaring and Coric holding two match points at 6-4, Federer went on the attack, turning the situation around and winning the tiebreaker 9-7 when the Croatian was unable to return a backhand volley.