Manchester United survived a second-half scare at Deepdale to see off Preston and set up an FA Cup quarter-final tie with holders Arsenal.
A season of high-profile cup upsets looked like it could claim yet another victim when Scott Laird fired the League One side ahead soon after the break.
But United’s disjointed attack finally found some fluidity when expensive loan signing Radamel Falcao was replaced after an hour, and recalled midfielder Ander Herrera led the revival.
Herrera, making only his third start in three months, squeezed home the equaliser with Wayne Rooney avoiding contact with the ball in an offside position, before Marouane Fellaini’s close-range finish gave United the lead in a thrilling tie.
Rooney, back playing in a more advanced role, made certain of victory with a late penalty that he won and converted himself to give the scoreline a gloss that Preston did not deserve.
If United boss Louis van Gaal did not quite restore Rooney to his front line for this tie, he did at least push his captain higher up the pitch from the deeper midfield position he has occupied recently.
His movement was impressive early on but being closer to the sharp end did not allow Rooney more scoring opportunities, with a blocked shot from Luke Shaw’s pull-back his only effort on goal in the first half.