Playing in his first game for more than 13 months having undergone two knee surgeries last year, 39-year-old Federer won a tense first-set tiebreak 10-8 before being broken by world No. 28 Evans near the start of the second set.
Evans closed out the second set — the first time he has taken a set off Federer in four meetings — but the Swiss star was able to edge out the decider with his first break of the match at 6-5.
“Dan had more energy left at the end but I was serving well and I thought I played actually a really, really good match so I’m incredibly happy about my performance,” Federer said in his on-court interview after the game.
The 20-time grand slam champion next faces Nikoloz Basilashvili in the quaraterfinals at the Qatar Open, a tournament he has won on three previous occasions.
He has dropped to No. 6 in the world rankings during his injury absence, but said he feels pleased to have come through the lengthy period of rehab that followed last year’s surgery.
“It’s been a long and tough road for me,” he said. “I’ve enjoyed it, though, it’s been a huge challenge of mine in my tennis career. To come back at my age is not something that’s very simple.
“I’ve had a wonderful team around myself that always supported me throughout and that made it much easier. It was worth it, because I played a great match today.”
Federer is no stranger to injury comebacks having recovered from a previous knee surgery in 2016 to win two grand slam titles.
The game against Evans, who has been a hitting partner of Federer’s over the past few weeks, was a tight affair that could have swung either way.
The British No. 1 had break points at 3-3 in the third set that were saved by Federer, who in turn found himself with a match point at 5-4 that was saved by Evans.
But Federer eventually closed out the contest two games later with a thumping, down-the-line backhand that set up a place in the quarterfinals.