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.
84 mins - Spain 1 Morocco 2
Spain are looking for the equaliser now but Morocco have everyone behind the ball. They're still committing little fouls, blocking the space, running faster and harder and longer than any Spain player. They seem quicker of thought too and Spain don't have any solutions.
Silva comes off, Rodrigo comes on.
78 mins - Spain 1 Morocco 1
Morocco are constantly fouling Spain players too, it's really difficult for the referee but it hardly seems fair that they're allowed to get so tight and come through the back of Spain players without threat of yellow card. It just means Spain can't do anything because they either lose the ball or win a free-kick in a largely harmless position.
76 mins - Spain 1 Morocco 1
Isco's final ball has been poor tonight. Everything else is exceptional but the cross into the box keeps being underhit.
It's just this all game long now. Morocco have everyone back, everyone charges at the man on the ball, Spain have to go sideways. I don't buy that it's admirable either. Anyone can defend like this and get a lucky result.
69 mins - Spain 1 Morocco 1
Morocco still have everyone behind the ball, Spain just passing from side to side without really being able to go anywhere else. Costa runs into space, the ball is played down the line by Alba and Thiago is teed up to shoot on the edge of the area! He blasts it way over the bar.
58 mins - Spain 1 Morocco 1
Dirar is scaring Spain. "Whenever he goes running it's like he's been fired from a gun!" says Martin Keown, with good reason. He's sprinting at 1000mph up the pitch and Spain can't get close to him and it's only the last lines of defence that prevent Dirar causing damage.
55 mins - Spain 1 Morocco 1
Morocco are working so hard here. They defend a corner and six players sprint up the pitch to take advantage of all the space Spain have left. Amrabat spots a chance to shoot and IT'S GOING IN! OFF THE BAR!
What an effort! This is sensational from Morocco. They'll be knackered by the 80th minute though...
49 mins - Spain 1 Morocco 1
Morocco want a free-kick for a handball on Pique but the referee doesn't see it despite standing right next to the incident. That would have been in a decent position too. Morocco press high and as soon as Spain get past them drop everyone behind the ball to block all space.
BBC's budget pundits
Leon Osman and Joleon Lescott have been summoned for the half-time punditry in the BBC's studio, which looks an awful lot like the same studio used in BBC Newsround during the 90s.
Spain got caught out then by a determined, angry looking Morocco team but had the sheer class and patience to get back into it. I can see more goals coming in the second half!
40 mins - Spain 1 Morocco 1
Isco runs himself into trouble and it's a late tackle by Boutaib... who hasn't been booked... but the referee doesn't show a yellow card.
Isco takes a ball to feet, turns his man and then nutmegs the next. Brilliant. Spain win a free-kick 35 yards out and that's a clear shirt pull, which again could be a yellow card.
36 mins - Spain 1 Morocco 1
Spain are really piling on the pressure. Busquets is spraying amazing passes out to the wide players, there's movement off the ball, Morocco are feisty and on yellow cards... but Silva's corner is caught by the goalkeeper.
Never mind, Spain are back in the Morocco final third again. Every first touch is perfect here and Iniesta is played in behind the defence again! His cut back is just behind his teammates in the box.
Spain win another corner as Alba runs in behind.
28 mins - Spain 1 Morocco 1
Isco has found space on the left wing, lays it back to Alba, who crosses and Morocco might be away! Iniesta slides into a challenge with Belhanda and stops the counter-attacking happening. Isco is causing Morocco real problems on the left wing and Carvajal is turning up wide right to offer a switched pass option too.
26 mins - Spain 1 Morocco 1
MOROCCO HAVE A ONE V ONE! DE GEA SAVES!
This game is mental! It's a quick throw-in and the centre-backs have been hopelessly exposed by Boutaib, who is through on goal. He's quick, away from the defence but his final touch is too far ahead of him and De Gea has the chance to close it down and block.
Morocco are right at it here!
24 mins - Spain 1 Morocco 1
Isco takes a corner and swings it deep into the box. Pique finds space and meets the cross... but his header is easily saved by the goalkeeper.
Spain have a big chance to score here! It's four players running at the Morocco back line but Iniesta's shot is blocked and Costa loses it!
17 mins - Spain 0 Morocco 1
Is it harsh to suggest De Gea should have done better there? If he was in a Man Utd shirt I'd expect him to save that every single time but there's this unquantifiable vulnerability to him at international level.
Morocco are just waiting to counter-attack over and again and Spain aren't enjoying themselves. They're full of confidence.
GOOOOOOOOOOAAAAAAAAAAAALLLLLLL!
MOROCCO TAKE THE LEAD!
Wow! That came out of nothing. It's a horrible error by Iniesta and Ramos at the halfway line and Boutaib has the entire half to run into! He sprints towards the box and only has De Gea to beat and you just knew he wasn't going to miss! The ball goes beneath De Gea's outstretched leg and Morocco go one up!
14 mins - Spain 0 Morocco 0
At first look that seems like a decent bit of defending by Hakimi but when you think about it, what he's done there is block the ball with his back and then deliberately batter into Silva to send him flying inside the box. It will never be penalty... but isn't it a foul?
There is so much movement in the Spain midfield. Isco and Iniesta jave dropped back but THERE'S A MISTAKE! MOROCCO ARE AWAY!
12 mins - Spain 0 Morocco 0
Great run from Costa off the ball! He moves into space on the right channel and the ball is played there. Costa turns,m passes back and Silva breaks into the area. He's behind the last man, wide of the goal but nobody is in the area to take advantage of his cross. Warning signs that Spain are getting into this game.
10 mins - Spain 0 Morocco 0
Now. The thing here is that Pique has gone in way too aggressively here, it's off the ground, two-footed and could cause serious injury. But he gets the ball and doesn't really touch the striker at all... but he goes flying (of course) and makes out that he's hurt. He's not, and Pique has gotten away with it.
This game is fiery.
8 mins - Spain 0 Morocco 0
It's all kicking off here! Amrabat is fired up and has had a little battle with Ramos after a collision from a 50/50. The two square up to each other... the fireworks are lit! The referee calms things down. For now.
And now Pique has gone in mega hard on Boutaib! Morocco are going nuts.
4 mins - Spain 0 Morocco 0
Spain move up the pitch and Costa wins a free-kick from his evil alter ego, Da Costa. Spain pass around the opposition half, Carvajal gets forward but loses control and Morocco move it around... but there's a mistake!
Isco overlaps... but his outside of the boot cross is too close to the goalkeeper.
2 mins - Spain 0 Morocco 0
Morocco have instantly gone into defensive mode and look like they're going to sit deep for most of this one.
Morocco get the first bit of attacking done though and a cross from the left by Hakimi - who is a left-back wearing number two (disgraceful) - goes behind for a goal kick.
Spain need one point to progress
But with Portugal likely to get a victory over Iran, there's just no way they'll settle for a point. The interesting thing about this game will be how Morocco deal with it - do they suddenly turn on the magic now there's no pressure? Or will they have a lack of real motivation and fall victim to Spain's sharp passing?
Good evening!
Welcome to our liveblog for Spain's final group game. Tonight they're going to try and put as many goals as possible past Morocco in the hope that goal difference will give them a better/easier opponent in the knock-out rounds of the World Cup, even if Fernando Hierro has been keen to stress that mathematically they still aren't through yet.
The brand new Spain manager has also pointed out that his side have a certain way of playing, and won't adjust for their opponents:
"If we had to change for muscle, we're something else, more than muscle. Honestly, we have our own way of playing, our own physique and muscle isn't going to work for us.
"We are a team. We like to attack and defend together and this is to stop our rivals from making transitions and stop them creating chances against us. For this reason we know we need to think about what we believe in and not about what the opposition coach is planning to do.
"Isco always brings quality, effort, one-on-ones, is combative and gets in between the lines. It's difficult for him to maintain a fixed position and he's performing very well, just like his teammates. He's performed at this elite level for a while now and we know what he can bring to the team."
Morocco are definitely out of the World Cup and may well opt to field some of the players who haven't yet made an appearance. They may also go with their strongest XI to avoid being given a hiding but it is expected that Spain should win this meeting comfortably, with the only question being how many goals will separate the two teams at the final whistle.
Team news should be with us very soon, at which point we can work out how both sides plan to approach the match and what is likely to happen during it! Stay with us for live analysis and updates throughout.