Leicester provided some much-needed joy for boss Claudio Ranieri with a 3-1 win against East Midlands rivals Derby in the FA Cup.
The champions, in a welcome break from their Premier League form, needed extra time to see off their Championship opponents and goals from Onyinye Ndidi and then Demarai Gray in the additional half an hour did the trick to set up a trip to Millwall in the fifth round later this month.
Andy King, captain for the night, headed Leicester in front at the start of the second half but Abdoul Camara's deflected free kick brought Derby level just after the hour.
The replay victory will be a relief for Ranieri, who on Tuesday was given the vote of confidence by the club, following a miserable run of results which has seen Leicester's title defence descend into a relegation dogfight.
Owner and chairman Vichai Srivaddhanaprabha was in attendance to offer Ranieri his "unwavering support'' and the Thai businessman will, in the short term at least, feel vindicated in his decision, although much bigger targets lie ahead.
Ranieri's selection dilemma ahead of the tie was whether to make wholesale changes and rest players ahead of Sunday's crucial Premier League clash against relegation rivals Swansea, or field something close to a first choice starting lineup in the hope of winning and building some much-needed momentum.
It was clear, and unsurprising, where his priorities lay. The Italian made 10 changes with Ahmed Musa the only survivor from the defeat to Manchester United at the weekend.
Derby also had their own agenda, securing a Championship playoff spot is their aim, and Rams boss Steve McClaren made eight changes.
With so many alterations, both sides lacked fluency and chances were few and far between during the 90 minutes after Daniel Amartey looped a header onto the roof of the Derby net early on.
Leicester appealed for a penalty midway through the first half following a coming together between Musa and Jason Shackell. There was contact but the Foxes forward appeared to go to ground too easily and referee Michael Jones rightly played on.
Jones was asked to make another call on a spot-kick six minutes before half-time when Derby captain Richard Keogh barged over Ben Chilwell but once more the Cheshire official ignored the host's protests.
It was not until first-half stoppage time that either goalkeeper was called on to make a save, Ron-Robert Zieler bucked the trend when pushing a low Jacob Butterfield effort wide.
The second half was less than a minute old when Leicester made what had looked like an unlikely breakthrough. Gray's deep cross was headed back across goal by Marc Albrighton and King nodded the ball home from inside the six yard box.
Derby equalised just after the hour mark when Camara's free kick, rolled into his path by Julien De Sart, flicked off Chilwell's knee and past Zieler who had already committed himself to the initial shot.
The visitors enjoyed a positive spell after drawing level but never troubled Zieler until Johnny Russell's 80th-minute strike, which was easily smothered by the German. Immediately at the other end, King's glancing header from Albrighton's corner drifted narrowly wide of the far post.
Leicester felt aggrieved for a third time in the match when young Derby goalkeeper Jonathan Mitchell escaped punishment for handling the ball outside of his area, after Musa was first to a pass over the top.
It seemed luck was perhaps destined to be with Derby on the night as in the final minute Max Lowe, with no Leicester player in sight, calmly chested a cross against his own post.
However, early in extra time Leicester led again through Ndidi. On as a substitute at the start of extra time, the January signing from Genk scored his first goal for the club just four minutes after his introduction, collecting the ball and driving forward before unleashing a shot from outside the area which flew into the net via a post.
Russell came close to an equaliser with a header but Leicester were in the ascendancy and Mitchell save dwell to deny King before Gray settled it after 114 minutes, showing quick feet down the left side of the penalty box before firing a shot into the roof of the net.