Jamie Vardy’s 73rd minute goal gave Claudio Ranieri’s a slim chance of qualifying for the next round after Pablo Sarabia and Joaquin Correa had given the Spaniards a two-goal advantage.
For Ndidi, it was his first game in the money-spinning club competition – and he was on from start to finish at Ramón Sánchez Pizjuán Stadium.
''Thank you Lord for my uefa champions league debut, tho not the result we wanted but unto the next one,'' he tweeted.
His compatriot, Ahmed Musa was handed a starter’s shirt but was replaced by Demarai Gray in the 58th minute.
The reigning English champions host Liverpool to King Power Stadium on Monday as they continue their battle for survival in the English topflight.