FA Cup: Preston 1 Man United 3
The England striker had not netted in nine games ahead of Monday's fifth-round tie, but completed the scoring with a late penalty after being moved back into an attacking role by Louis van Gaal.
Scott Laird's second goal of the season just after half-time had put Preston boss Simon Grayson on course to spring another FA Cup shock against United, having masterminded Leeds United's victory at Old Trafford in 2010.
Van Gaal's side avoided an upset, though, as Ander Herrera and Marouane Fellaini marked their recalls to the starting line-up with goals and Rooney struck from the spot after he had been upended by Preston goalkeeper Thorsten Stuckmann.
United will now face Arsenal in a mouth-watering last-eight tie at the Emirates Stadium next month as they attempt to win the FA Cup for the first time in 11 years and give Van Gaal a trophy in his first season at Old Trafford.
Preston gave a good account of themselves, but were unable to pull off a stunning victory over their Lancashire rivals and must now turn their attentions back to their League One promotion push.
United were not allowed to settle as the tie was played at a frantic pace, but Angel di Maria was only just off target with a free-kick 13 minutes in.
The Premier League side lacked quality in the final third in a poor first half, but Rooney looked poised to put them in front when Radamel Falcao laid the ball into his path just before the break until Bailey Wright intervened with a fine challenge.
While the first 45 minutes had produced very little entertainment, it took just two minutes of the second half for the game to spark into life when Laird put Preston in front.
The full-back burst into the penalty area to get on the end of a nicely weighted Paul Gallagher pass and his left-foot strike deflected off Antonio Valencia and went under David de Gea, who should have done better.
Some outstanding defending from Paul Huntington denied Fellaini what would surely have been an equaliser, but United were level when Herrera marked his return to the side with a goal after 65 minutes.
The Spanish midfielder got the ball stuck under his feet after taking a pass from substitute Ashley Young in the penalty area, but his left-foot strike crept in off the far post.
Preston felt the goal should have been ruled out as Rooney was stood in an offside position, but it stood as the England captain did not get a touch on the ball and was not deemed to be interfering with play.
United were on the front foot and Fellaini put them front 18 minutes from time when Valencia picked him out with a cross to the far post and the Belgium midfielder fired home from close range after his initial header was saved by Stuckmann.
Stuckmann then upended Rooney two minutes from time and the striker sent the keeper the wrong way to ensure United progressed.