Spain have qualified for the Round of 16 at the top of Group B on goals scored by the skin of their teeth and by virtue of a stoppage time equaliser from the substitute Iago Aspas.
The insouciant near-post flick sealed an ill-tempered 2-2 draw with Morocco in Kaliningrad in which Gerald Pique escaped a red card and he and his fellow veteran centre-back, Sergio Ramos, made errors that cost the 2010 winners their goals.
In the end they needed VAR to judge that Aspas had not been offside in the tightest of calls which, once it went their way, sparked anger and jostling on the touchline from Morocco’s players and staff.
Khalid Boutaib opened the scoring in the 14th minute after a madcap misunderstanding between the captain Ramos and Andres Iniesta allowed him through on goal and he finished with rare calm. He should have scored another 10 minutes later when he beat the offside trap but shot straight at David De Gea.
Isco scored a superb equaliser in the 19th minute when Iniesta rolled back the years and danced through the penalty area and dragged the perfect pass to his team-mate who took a touch and fired a shot into the roof of the net from five yards.
But Spain rarely hit such heights again and though Morocco’s heavy tackling was punished with six yellow cards, they remained on the front foot and took the lead again through En Neysri’s towering 81st-minute header when Pique jumped under the ball.