Nottingham Forest knocked Premier League Newcastle out of the Carabao Cup for the second consecutive season after a dramatic finale.
Championship outfit Forest took the lead in the second minute when former Newcastle striker Daryl Murphy nodded in Sam Byram's cross from close range.
Newcastle equalised in the second of six minutes of injury time when Salomon Rondon angled in a powerful low shot.
But two minutes later Matty Cash fired home before Gil Dias' late chip.
Forest met Newcastle at the same stage of competition last season and claimed a thrilling 3-2 victory at St James' Park.
The conclusion to this match was just as enthralling as Forest deservedly secured their place in the third round.
Aitor Karanka's side had taken the lead when on-loan West Ham full-back Byram crossed for Murphy at the near post.
Murphy, who scored six times in 18 appearances in all competitions for Newcastle, escaped his marker and glanced a header past Newcastle goalkeeper Karl Darlow.
Murphy almost had a second five minutes into the second half when Darlow fumbled a shot from Dias, only for Federico Fernandez to make a brilliant last-ditch block.
Darlow, a former Forest player, made a crucial save just after the hour mark when he pawed away an audacious chip from Joao Carvalho.
Forest seems to be cruising to the finish only for substitute Rondon to equalise with clinical finish - Newcastle's only attempt on target in the match - after a clever pass from Ayoze Perez.
However, Forest hit back when Darlow parried Dias' shot and Cash arrived in the penalty area to slide the ball home.
Newcastle then had a strong claim for a penalty when Luke Steele bundled over Perez inside the box but referee Jeremy Simpson waved play on.
The impressive Dias then caught Newcastle on the counter and superbly chipped Darlow to seal the victory.