Match ends, Chelsea 3, Derby County 2.
Chelsea knocked Derby out of the Carabao Cup in the fourth round as Frank Lampard's return to Stamford Bridge as a manager ended in a dramatic defeat.
Five goals were scored in a frantic first half, including two own goals from Derby defenders Fikayo Tomori and Richard Keogh.
The Championship side came from behind twice through Jack Marriott and Martyn Waghorn.
But Cesc Fabregas slotted home four minutes before half-time for what proved to be the winner.
Derby substitute David Nugent hit the inside of the post with a minute of normal time remaining but the ball rebounded safely into goalkeeper Willy Caballero's hands.
Chelsea have been drawn at home to Bournemouth in a repeat of last season's quarter-final.
- Football Daily podcast: A somewhat Sarri return for Lampard
- Name the Chelsea XI in Lampard's last game
- Relive Wednesday's fourth-round ties
The visitors had chances in the second half as Mount, Marriott and Keogh went close, while Chelsea's Gary Cahill was denied from close range and Alvaro Morata had a header saved by keeper Scott Carson.
Before kick-off, a minute's applause was held in tribute to the victims of Saturday's helicopter crash at Leicester City. Former Foxes boss Claudio Ranieri - who managed Chelsea from 2000 to 2004 - was at Stamford Bridge.
On-loan duo impress as Derby show fight
It was a big night for Chelsea's two on-loan players Tomori and Mount, who were given permission to face their parent club.
Tomori's own goal after just five minutes - which deflected backwards off his standing leg as he attempted to clear Davide Zappacosta's cross - was greeted with encouragement from Lampard, who gestured to remain calm.
Derby responded as Marriott coolly fired an equaliser into the far corner and, after Keogh's own goal - a deflection from another Zappacosta cross - they did so again when Mount turned provider for Waghorn.
Mount showed composure when he slid an inch-perfect ball across goal and he was impressive in the second half, twice going close to scoring.
Both loanees had a point to prove in front of Chelsea's staff and their displays certainly did that - and also showed how the loan system can be beneficial to the Blues.
Chelsea had 70% of the possession but Derby were no bystanders with seven shots on target to the hosts' five.
The side sixth in the Championship were a constant threat in the second half as Marriott's drive was tipped onto the top of the net and Mount went close with a powerful long-range effort.
Keogh almost equalised in the 84th minute when Tom Huddlestone played a sublime ball over the top, while Nugent thought he had scored but saw his shot rebound off the inside of the post.
But Fabregas' goal proved the winner as he took advantage when the ball ricocheted kindly from Chelsea right-back Zappacosta, who was involved in all of their goals.
'Lucky man' Lampard's memorable return
Chelsea held on to deny Derby another shock win in this competition but it was still an emotional evening for Rams' boss Lampard.
Lampard played 648 times for Chelsea and is the club's all-time leading goalscorer. Before the match, he said he would be "proud and honoured" to face a "club that was his home for 13 years".
It has been a good start to management for Lampard as Derby sit just four points off the Championship leaders - and were unbeaten in five games coming into this tie. They also eliminated Manchester United in the third round, triumphing 8-7 on penalties at Old Trafford.
Lampard received a warm welcome from the home supporters as banners displayed the words "forever a blue, forever a legend" and his name was sung by Chelsea supporters shortly after Fabregas' goal.
He said he was "a lucky man to have a night like that" at full-time and was visibly emotional as he thanked supporters.
'We scored four, didn't we?'
Chelsea assistant manager Gianfranco Zola: "It was a tough game. Derby were excellent. They created us more problems. Our defence wasn't as good as other times. But most of the problems were created by them.
"We were in control until about 10-15 minutes to go. In those moments we thought about scoring too much. When you open up against a team with that quality, it is 50-50. We were lucky on occasions."
Derby boss Frank Lampard on Sky Sports: "I'm disappointed. I think we deserved a draw on chances created. The difference between the sides was they scored three... actually we scored four, didn't we? I joke because I'm proud.
"My players had to do really selfless stuff. Who goes through clear against Chelsea like we did on goal? We created chances.
"I'm so thankful to the Chelsea fans. I left through the back door and it upset me at the time but I have nothing but great memories of this place and they thank me like that. I'm a lucky man to have a night like that and I feel it."
Stable Bridge - the best of the stats
- Chelsea have now won 11 of their past 12 home games against Derby in all competitions, netting 37 goals in those matches (3.1 per game).
- This was Lampard's first defeat at Stamford Bridge as either a player or manager since September 2013 when Chelsea lost 2-1 to Basel in the Champions League.
- Chelsea have won 11 of their past 12 home League Cup games against sides from outside of the Premier League, drawing the other 1-1 with Burnley in November 2008 before being eliminated on penalties.
- Derby are the first team to score two own goals against Chelsea since Stoke did so in the Premier League in January 2013.
- Marriott has been directly involved in six goals in his past five games for Derby in all competitions (four goals, two assists).
- Fabregas has had a hand in seven goals in his past seven League Cup appearances for Chelsea (three goals, four assists).
- 21ZappacostaSubstituted forAzpilicuetaat 78'minutes
- 27ChristensenSubstituted forDavid Luizat 66'minutes
- 33EmersonBooked at 84mins
- 12Loftus-CheekSubstituted forPedroat 69'minutes
- 30David Luiz
- 6KeoghBooked at 90mins
- 46MaloneSubstituted forForsythat 82'minutes
- 9WaghornSubstituted forBennettat 62'minutes
- 7WilsonSubstituted forNugentat 82'minutes
- Jonathan Moss
- Shots on Target
Second Half ends, Chelsea 3, Derby County 2.
Richard Keogh (Derby County) is shown the yellow card for a bad foul.
N'Golo Kanté (Chelsea) wins a free kick in the attacking half.
Foul by Richard Keogh (Derby County).
Willian (Chelsea) wins a free kick on the left wing.
Foul by Tom Huddlestone (Derby County).
David Nugent (Derby County) hits the left post with a right footed shot from the right side of the box. Assisted by Jack Marriott with a through ball.
Attempt saved. Jack Marriott (Derby County) right footed shot from the right side of the box is saved in the bottom right corner. Assisted by Jayden Bogle.
Attempt saved. Mason Mount (Derby County) right footed shot from outside the box is saved in the bottom left corner. Assisted by Richard Keogh.
Attempt saved. Richard Keogh (Derby County) right footed shot from the centre of the box is saved in the centre of the goal. Assisted by Jayden Bogle with a through ball.
Emerson (Chelsea) is shown the yellow card for a bad foul.
Foul by Emerson (Chelsea).
Jayden Bogle (Derby County) wins a free kick on the right wing.
Substitution, Derby County. David Nugent replaces Harry Wilson.
Substitution, Derby County. Craig Forsyth replaces Scott Malone.
Foul by David Luiz (Chelsea).
Scott Malone (Derby County) wins a free kick in the defensive half.
Corner, Chelsea. Conceded by Scott Carson.
Attempt saved. Álvaro Morata (Chelsea) header from the centre of the box is saved in the bottom right corner. Assisted by Willian with a cross.