After a scrappy and goalless first half, the visitors twice came back from a goal down against a youthful United side before "Little Pea" Hernandez skipped past defenders to settle the tie in the 90th minute.
"When he came on, you just know that if he gets a chance he is going to take it," United manager Alex Ferguson, who replaced his entire starting line-up from the weekend, said.
“It was a magnificent goal. The boy is justifying the praise, his goal-scoring is getting a lot of credit and quite rightly, too. His composure, touch, vision and control is improving and that is down to the training,” Ferguson added.
West Bromwich Albion roared through to the last eight with a thumping 4-1 victory at former England manager Sven-Goran Eriksson's Championship (second division) side Leicester City.
Wigan Athletic beat second division Swansea City 2-0 with Argentine striker Mauro Boselli scoring his first goal for the club since his signing from Estudiantes.
The run of fourth division Northampton Town, who knocked out Liverpool at Anfield on penalties, ended at second division Ipswich Town where they lost 3-1 despite opening the scoring with a looping Liam Davis shot. Third division Brentford, who knocked out Everton on penalties in the previous round, took their second Premier League opponents to spot-kicks before losing 4-3 at Birmingham City.
The hosts, rocked by a 68th-minute Sam Wood volley, had escaped by the skin of their teeth thanks to a Kevin Phillips equaliser deep into stoppage time.
United, with a team Ferguson described as a glimpse into the future, were lacklustre in the first half before coming alive. Portuguese striker Bebe, making his first start for United, had opened the scoring with a strike deflected in by George Elokobi who then equalised with a header.
Park Ji-sung made it 2-1 in the 70th but Wolves, who had not scored at Old Trafford since 1980, refused to lie down and Kevin Foley again levelled with a low shot in the 76th.
United also brought on 17-year-old Ravel Morrison, tipped as a big talent for the future, as a substitute in the dying seconds.