After eight years without participation, Spain qualified for the 2012 Summer Olympics after winning the 2011 UEFA European Under-21 Championship under head coach Luis Milla. They were scheduled to play against Japan, Morocco and Honduras in the group stage. Before the start of the tournament, Spain scheduled three friendly matches against teams that would be competing at the Olympics: The first was a 3–1 victory over Egypt, followed by a 2–0 defeat against Senegal and a 1–0 victory over Mexico five days later. At the Olympics, Spain was eliminated in the group stage after falling shockingly 1–0 to Japan and a controversial loss to Honduras. This was followed by a 0–0 draw to Morocco, forcing Spain's exit from the tournament at the group stage for the first time, and without scoring a single goal. Luis Milla was sacked from both the under-23 and under-21 teams the following day and replaced by Julen Lopetegui.