It was the 26-year-old’s third appearance at the tournament at centre-back, but he wasn’t partnered alongside City teammate Aymeric Laporte who settled for a place on the bench for the first time in Qatar.
On a night of twists and turns, Spain were momentarily heading home when Costa Rica took the lead against Germany in Group E’s other game.
But Hansi Flick’s side’s eventual 4-2 win helped secure passage for Luis Enrique’s team on goal difference.
Alvaro Morata twice came from the bench to score in Spain’s opening two matches, and he made the most of his starting chance against Japan by breaking the deadlock.
The former Chelsea man intelligently drifted between two defenders to rise high and head home Cesar Azpilicueta’s accurate cross.
With chances few and far between, Spain took a narrow lead into the interval, despite looking comfortable throughout the first half.
But their advantage was wiped out five minutes after the break as Japan netted two quickfire goals.
The first came when Ritsu Doan unleashed a curling effort from the edge of the box that Unai Simon could only palm into the net.
Hajime Moriyasu’s side then took the lead moments later when Ao Tanaka tapped home Kaoru Mitoma pull back from the touchline.
There was momentary VAR concern for Japan but the goal was signed off.
The wind had been taken from the 2010 World Cup winners’ sails and it was their opponents looking most likely to score again.
Brighton’s Mitoma was causing problems on the the left wing and his drive down the flank and cross was met by Doan who couldn’t direct his effort towards goal.
Defeat for Spain means they finish second in Group E, handing them a last-16 tie with Morocco on Tuesday 6 December at 15:00pm (UK).