Middlesbrough needed a 95th-minute winner as they survived a Mansfield fightback to progress in the FA Cup.
The Championship side raced into a 2-0 lead inside 15 minutes as Uche Ikpeazu found the top corner from 20 yards before Caolan Boyd-Munce fired home.
League Two Mansfield rallied after the break as Oli Hawkins headed in and Rhys Oates slotted home from a tight angle.
But Boro won the tie in stoppage time when John-Joe O'Toole could only turn Isaiah Jones' cross into his own net.
It was a horrible way for Stags boss Nigel Clough to see his side lose after such a brave fightback against the club where his father Brian made his name as a player.