He'll be joined in Round 4 by Kevin Anderson, who got the better of Joao Sousa and beat the Portuguese 6-4, 7-6 (6) to set up a meeting with Jordan Thompson in the next phase of the tournament.
Thompson surprised 24th-seeded Grigor Dimitrov earlier in the day and downed the Bulgarian in straight sets 7-5, 7-5 to advance to the fourth round.
Ashleigh Barty was among the first women to clinch a quarter-final berth in Miami after she upset seventh seed Kiki Bertens. No. 3 seed Petra Kvitova and No. 21 seed Anett Kontaveit will move on to the last eight after they got the better of Caroline Garcia and Bianca Andreescu (retired), respectively.
Eighth seed Stefanos Tsitsipas will be on court against Leonardo Mayer later on Monday, while American Frances Tiafoe must beat David Ferrer if he's to join Thompson in the next phase of the tournament.
Jordan Thompson bt. (24) Grigor Dimitrov: 7-5, 7-5
(6) Kevin Anderson bt. Joao Sousa: 6-4, 7-6 (6)
(4) Roger Federer bt. Filip Krajinovic: 7-5, 6-3
(12) Ashleigh Barty bt. (7) Kiki Bertens: 4-6, 6-3, 6-2
(3) Petra Kvitova bt. (19) Caroline Garcia: 6-3, 6-3
(21) Anett Kontaveit bt. Bianca Andreescu (retired): 6-1, 2-0
There was little stopping Federer from sealing his return to the Miami Open's last 16 on Monday, overcoming a slight wobble at the beginning of his match against Krajinovic to progress from the third round.
Th Swiss suffered the first break of the match early on but immediately hit back with one of his own and timed the more essential strokes in what turned into an efficient display.
Federer was at times lurching in his tournament-opening win against Radu Albot, but a flourished finish against Krajinovic suggested he was already feeling more comfortable in Miami, via the Tennis Channel:
The three-time champion wasn't present to defend his 2017 title last year, but Federer's improvement between rounds is a worrying development for his potential opponents.
Thompson, 24, reached the quarter-finals of the New York Open in February and was knocked out of that contest by John Isner, who happens to be on the other side of the bracket in Miami this week.
Dimitrov pulled out of the BNP Paribas Open earlier in March because of a persisting shoulder injury, and the rust was evident for him in what was a scrappy two sets of tennis by his standards.
Thompson wasn't pristine in his play, either, but the Australian suffered one break fewer than his opponent in each set and clinically won the last three games to turn a 4-5 deficit into a straight-sets win.
Dimitrov saved three match points at 6-5 down but couldn't hold back an opponent who's already shown drastic improvements upon last season, per the ATP:
Thompson's fourth-round opponent, Anderson, won back-to-back games for the first time since the opening week of the 2019 season when he beat Sousa.
The Portuguese hopeful won their only previous meeting in Nice almost three years ago, but South African Anderson leaned heavily on his superior serving to see out the victory, per FlashScore.com.
Barty has impressed so far in 2019 but will have to elevate her game considerably for the quarter-final clash against Kvitova. The former could finish in the WTA's top 10 if all goes right for her this week, and Barty celebrated after a hard-fought comeback victory against the Netherlands' Bertens:
Kvitova was more routine in her straight-sets win against Garcia and will return to the Miami Open's last eight after five years away, via WTA:
Injury saw Andreescu pull out of her clash against Estonian Kontaveit during the second set, ending the Canadian's Miami title challenge in glum fashion.
Novak Djokovic will be back in action on Tuesday as he prepares to face Roberto Bautista Agut in their fourth-round faceoff.