Wilfred Ndidi put a smile back on Claudio Ranieri's face as the Leicester City midfielder's first goal for the troubled champions inspired a 3-1 win over Derby in Wednesday's FA Cup fourth round replay. Ranieri has found himself under fire after Leicester slumped to within one point of the Premier League relegation zone less than a year after their fairytale title triumph. Amid claims Ranieri has lost the support of his squad, the Leicester boss was given a vote of confidence by the club's Thai owners on Tuesday.
But Ranieri was in danger of an embarrassing Cup exit when second tier Derby forced extra-time at the King Power Stadium thanks to an Abdoul Camara equaliser after Andy King's opener.
Ndidi was Ranieri's saviour as the Nigeria international, who joined from Belgian club Genk in January, came off the bench to score with a superb long-range effort before Demarai Gray's solo strike clinched Leicester's first win in six matches.
Next up for Leicester in the Cup is a fifth round trip to third tier Millwall on February 18, but Ranieri knows ensuring top-flight survival is all that matters this season.
Having labelled Sunday's trip to fellow strugglers Swansea as a "big battle" it was no surprise Ranieri made 10 changes from last weekend's 3-0 defeat against Manchester United.
And with Derby boss Steve McClaren making eight changes for the promotion chasers, what could have been a blood and thunder cup tie was more akin to a reserve fixture for long periods.
Ranieri's approval rating with Leicester's supporters remains high and they sung his name loudly in the opening stages.
However, his makeshift line-up laboured to reward the fans' good faith in a turgid first half.
On the brink of half-time, Jacob Butterfield almost put Derby ahead when his fierce low strike was turned away by Leicester goalkeeper Ron-Robert Zieler.
Having struggled in the first half, Ranieri's side finally pieced together an incisive attack to take the lead in the 46th minute.
Gray was the catalyst, cleverly working space for a cross to the far post, where Marc Albrighton nodded back across goal to King and the long-serving Leicester midfielder headed home from close-range.
But when Derby's Camara smacked a free-kick straight at Zieler moments later, it foreshadowed more frustration for Leicester.
In the 61st minute, Albrighton gave away a free-kick 25 yards out and this time Camara struck gold as the Guinea winger's shot took a wicked deflection off Ben Chilwell and flashed past the wrong-footed Zieler for his first ever Derby goal.
Late in normal time, Derby keeper Jonathan Mitchell somehow avoided a red card from referee Mike Jones despite stopping Ahmed Musa's raid by racing out of the area and blocking with his hand.
Derby had a lucky escape when Max Lowe chested the ball against his own post, but Leicester finally conjured a moment of inspiration to win it four minutes into extra-time.
Riyad Mahrez fed fellow substitute Ndidi who advanced unchecked before unleashing a blistering strike that beat Mitchell and went in off a post.
Gray capped Leicester's encouraging finale in the 114th minute when he went on a mazy run through the Derby defence and guided a cool finish into the roof of the net.