A real Jekyll and Hyde performance from Spain, who stumbled through to the second round with a thrill-a-minute, 2-2 defeat to already eliminated Morocco, and then got a helping hand from Iran's late penalty equaliser in the other game to finish ahead of Portugal and win Group B.
At times Spain give the impression they could beat anybody, especially when Isco and Andres Iniesta are combining at their dancing best. They created enough chances during a purple patch in the first half to win most matches, and they clearly still have enough creative talent to take on anybody.
There was also an impressive reaction to falling behind with just nine minutes remaining to get the equaliser, which means a last-16 meeting with Russia (not Uruguay) and a path on the easier side of the draw.
Spain also gave the impression they could lose to anybody, with some very shaky moments in defence and a surprising general shapelessness to their team.
The biggest problem lies at the back, where nervousness from goalkeeper David De Gea has now spread to both centre-backs Sergio Ramos and Gerard Pique.
Coach Fernando Hierro also needs to get his midfield balance sorted -- and it looks clear that one of his aging playmakers has to drop out of the XI.
Manager rating out of 10
5 -- Hierro maintained a conservative selection policy, with just one change to his XI -- bringing back playmaker Thiago Alcantara for winger Lucas Vazquez. He was again very slow to change things, as mentor Vicente del Bosque used to be, with inertia from the bench contributing to Morocco's seizing the initiative in the second half.
After all the turbulence pre-tournament, Hierro's policy of keeping things as quiet as possible off the pitch is leading to too much drama on it. He needs to make some more decisive selection decisions ahead of the knockout rounds.
Player ratings (1-10; 10 = best. Players introduced after 70 minutes get no rating)
GK David De Gea, 5 -- Not at fault for either goal, but his confidence is clearly still lacking following recent mistakes. After one shaky punch early in the second half, his defenders started ignoring his calls and going for clearances themselves -- never a good sign.
DF Dani Carvajal, 6 -- Did what he had to do in defence and had contributed little in attack until it was his cross substitute Iago Aspas converted for the equaliser in added time.
DF Sergio Ramos, 5 -- Partly responsible for both Morocco goals -- losing concentration completely for the first, and then being out-jumped at a corner for Youssef En-Nesyri's late winner.
DF Gerard Pique, 5 -- Lucky not to be booked at least for going off his feet during feisty early exchanges, and had his own lack of focus to gift Morocco's first scorer Khalid Boutaib another chance at 1-1. Also got away with needless handball outside own box early in second half.
DF Jordi Alba, 6 -- Again more noticeable in attack with a lot of Spain's moves coming down their left, but his opposite number, Nordin Amrabat, among Morocco's best players and almost scored 30-yard screamer.
MF Sergio Busquets, 6 -- Close to scoring at a set piece and did a decent job of keeping tabs on Morocco's central playmaker Younes Belhanda, who was taken off early.
MF Andres Iniesta, 6 -- Central to the mistake leading to Morocco goal, he quickly drove his team forward and made amends with a superb assist for the equaliser. Untouchable at times in the first half, but the 34-year-old faded badly out of things after the break.
MF Thiago Alcantara, 6 -- Given a first international tournament start, he came more into the game after half-time with some incisive passing and was a bit unlucky to be the first midfielder taken off.
MF Isco, 8 -- Had been Spain's best player outside the penalty area in the first two games, he got his first goal of the tournament with a very calm and decisive finish and almost added a second with a towering header at the back post.
MF David Silva, 5 -- Created one half-chance with a run into the box but another below-par performance on the right wing. Lucky not to be hooked earlier and must be in serious danger of losing his starting spot.
FW Diego Costa, 6 -- Involvement in the tiki-taka before Isco's goal showed he can play the link-up stuff, too, but he really should have scored his fourth goal of the tournament when just not getting enough on an Iniesta cross close to half-time.
FW Iago Aspas, 7 -- A lovely flicked finish for the equaliser was given via VAR after the officials on the pitch thought it had been offside.
FW Marco Asensio, 6 -- On the pitch long enough to work the short-corner routine with Carvajal that led to his fellow sub's late goal.
FW Rodrigo, N/R -- Was on for only a few minutes.