Sergio Romero saved Manchester United from an embarrassing exit in the EFL Cup as Ole Gunnar Solskjaer's side needed penalties to knock out third-tier Rochdale after a 1-1 draw.
Mason Greenwood put United in front in the second half on Thursday (AEST), the teenager scoring for the second week in a row after netting the winner against Astana in the Europa League.
But the League One side stunned Old Trafford with an equaliser scored by 16-year-old Luke Matheson, who was set up by United academy product Ollie Rathbone.
That sent the game to penalties and when Romero kept out Jimmy Keohane's effort, Daniel James was able to convert United's last kick and complete a 5-3 shoot-out victory.
Paul Pogba, making his first appearance of the month after an ankle injury, wasted two early efforts then Robert Sanchez made a fine block to keep out Marcos Rojo's header.
The France midfielder was performing poorly, missing a six-yard sitter of a header from Greenwood's cross before smashing a long-range strike well over the crossbar.
Rochdale made it to the break after Jesse Lingard's header flew narrowly over and they should have taken the lead in the 52nd minute when Rathbone did brilliantly to tee up Callum Camps, only for his mishit shot to be cleared off the line by Aaron Wan-Bissaka.
With the tempo rising United soon went close twice at the other end through Greenwood, but he would not be denied in the 68th minute.
Collecting a pass from Lingard on the right side of the box, Greenwood cut inside on to his left foot and rifled a low shot past Sanchez to bring Old Trafford to its feet.
Rochdale incredibly drew level within eight minutes, though, as Rathbone's high cross was turned home at the back post by teenager Matheson.
Brian Barry-Murphy's side could not complete one of the great cup upsets as Romero made the key save to put United through to the fourth round, where they will face Chelsea at Stamford Bridge next month.
What does it mean? Identity issues continue for Solskjaer
United continue to struggle after losing away to West Ham at the weekend, with Solskjaer unable to inspire his side to produce the fast, attacking football he wants to bring to Old Trafford. His faith in youth is admirable, but some of the young players he is using look out of their depth. Rochdale were relatively untroubled at the back and can be hugely proud of their display.
Matheson's moment to remember
Right-back Matheson was already enjoying a fine performance in the Rochdale defence and he will never forget his goal at Old Trafford. In truth, Rathbone's cross was probably mishit, and the finish was perhaps a little scruffy, but Matheson's desire to get into the box was justly rewarded.
Pogba shows lack of interest
The mentality of Pogba has often been called into question and displays like this are why. Even from the casual way he walked out at Old Trafford he did not look in the mood and he arguably should have scored at least two first-half goals.
He was not the only senior player to disappoint, with Lingard anonymous and Rojo bizarrely taking six shots at goal in the opening 45 minutes, despite playing at left-back. But Pogba's failure to step up to take a penalty in the shoot-out was particularly notable.
United's next game is also at home, with Unai Emery's Arsenal heading to Old Trafford on Monday. Wycombe Wanderers visit Rochdale in League One this weekend.