La Roja were forced to accept a second-placed finish in Group E behind Japan, who stunned the 2010 champions with a 2-1 win on the final matchday last Thursday.
Meanwhile, the Atlas Lions ripped up the script to pip both Belgium and Croatia to top spot in Group F with seven points from their nine games, having overcome Canada 2-1 in their third match.
Luis Enrique's side cannot afford to underestimate their African opponents this week, and the two nations are no strangers to meeting one another on this stage, having clashed three times previously.
Spain and Morocco first did battle in the CAF-UEFA playoff during qualifying for the 1962 World Cup, where La Roja ran out 1-0 winners in the first leg before welcoming the Atlas Lions to the Bernabeu.
The legendary Alfredo Di Stefano was on target for Spain, who were handed a couple of scares but nevertheless secured a 3-2 win to advance to the finals, and the two sides would not lock horns again for another 57 years.
Group B of the 2018 World Cup in Russia saw Spain and Morocco paired with one another, and the two sides played out a thrilling 2-2 draw on the final matchday after Isco had initially given La Roja the lead.
Morocco turned the tie on its head through Khalid Boutaib and Youssef En-Nesyri's finishes, but in the first minute of second-half injury time, Iago Aspas rescued a point for Spain to see them top the group and eliminate the fourth-placed Atlas Lions.
MOROCCO VS. SPAIN HEAD-TO-HEAD RECORD
Morocco wins: 0
Spain wins: 2
Draws: 1
Morocco goals: 4
Spain goals: 6
MATCH HISTORY
November 12, 1961: Morocco 0-1 Spain (World Cup qualifying playoff)
November 23, 1961: Spain 3-2 Morocco (World Cup qualifying playoff)
June 25, 2018: Spain 2-2 Morocco (World Cup)
Read more on Morocco vs Spain
Click here to read our full preview for Morocco vs Spain
How Morocco could line up against Spain
How Spain could line up against Morocco