Spain were defeated 2-1 by Japan in their final group stage game on Thursday night, putting at risk their place in the round of 16. La Roja eventually sealed their place in the first knockout stage, but only because Germany beat Costa Rica.
Despite making several changes to the starting eleven, Luis Enrique's side scored the opening goal after ten minutes and had the game under control.
The problem for Spain was their second-half performance, which was unacceptable for a side that scored seven in the first game of the tournament.
Japan had come out in the latter half like a raging bull. The Asian side had scored their two goals in quick succession at the start of the half, overturning the score and putting La Roja in a tricky position- they now needed to win to finish first.
Luis Enrique made changes to try and equalise, but the Japanese defence was too solid and there was no way for Spain to break through.
With 20 minutes to go, Costa Rica had gone 2-1 up against Germany, and they could have been eliminated alongside Spain. But the Germans managed to equalise and eventually win, which helped La Roja's cause, but it meant they were eliminated.
Despite Spain's eventual defeat to Japan, they still made it through to the round of 16, where they will play Morocco on Tuesday 6 December at 4pm.