Steve Davies put Derby into round four of the FA Cup after a dramatic win over non-league Forest Green Rovers.
Early goals by Jonathan Smith and Alex Lawless put the hosts on course for a shock win.
But with half-time looming, Kris Commons set up Rob Hulse's header and then Martin Albrechtsen to level.
Paul Stonehurst put Rovers ahead only for Paul Green to reply for Derby and at the death Darren Jones was red for conceding a penalty, netted by Davies.
Forest Green manager Jim Harvey:
"We were 3-2 up again in the second half and I thought that might be enough but it was not to be.
"To take the lead three times against Derby was magnificent for a club our size and I think the people here had terrific entertainment.
"But on reflection, we had it within our grasp to win it - we had believed we could do that for the whole game."
Derby caretaker manager Chris Hutchings:
"We were very lucky to go in level at 2-2 at half-time.
"We kept going at it right to the death - I suppose it was a classic cup tie with lots of goals and tackles and a sending off for our penalty.
"It was a good, honest cup tie and I'm glad we stayed strong to win it."
Sent Off: Jones (86).
Booked: Gill.
Goals: Smith 14, Lawless 20, Stonehouse 72.
Derby: Carroll, Beardsley, Albrechtsen (Powell 46), Nyatanga, Camara, Teale (Barazite 71), Green, Addison, Commons, Varney (Davies 81), Hulse.
Subs Not Used: Bywater, Savage, Villa, Barnes.
Booked: Commons, Hulse, Davies.
Goals: Hulse 40, Albrechtsen 45, Green 76, Davies 87 pen.
Att: 4,836
Ref: Paul Taylor (Hertfordshire).