Harry Wilson, Andreas Pereira and Layvin Kurzawa scored as Fulham progressed to the fifth round of the FA Cup.
After goals from Wilson and Pereira, Jack Clarke curled a fine effort into the far corner five minutes before Kurzawa effectively sealed victory for the Whites, who will face Leeds for a place in the quarter-finals.
Championship side Sunderland pushed them hard and Jewison Bennette’s stoppage-time goal left Fulham hanging on at the end.
Wilson’s early opener gave his team a perfect start to what always seemed like it might be a tricky fourth-round replay.
It came after Sunderland failed to deal with Kenny Tete’s ball in from the right.
Patrick Roberts, playing against his former club, could only head as far as Carlos Vinícius, and the Brazilian, with his back to goal, teed up Wilson, who poked the ball into the bottom corner of the net with the outside of his right boot.
Fulham had to withstand a spell of second-half Sunderland pressure, during which Roberts was denied by a save from Marek Rodak, and Amad Diallo by Shane Duffy’s goal-line clearance, before the visitors doubled their lead against the run of play.
Tom Cairney played a clever ball in to Aleksandar Mitrovic, who was closed down by keeper Anthony Patterson but managed to set up fellow substitute Pereira for a simple tap-in.
Clarke’s strike gave the Black Cats hope but they were then punished for failing to clear Pereira’s corner.
Cairney headed the ball back towards goal and Duffy flicked it on for Kurzawa to volley in from close range.
A slip by Kurzawa enabled Bennette to fire home as Sunderland refused to accept defeat.
Fulham: Rodak, Tete (De Cordova-Reid 65), Duffy, Tosin, Kurzawa, Harris (Pereira 45), Palhinha (Reed 65), Cairney, Wilson, Solomon (James 79), Vinícius (Mitrovic 45).
Subs not used: Leno, Willian, Diop, Robinson.