Despite falling to a 2-1 defeat against Japan in their final group-stage fixture, Luis Enrique's men managed to qualify as runners-up in Group E.
On the other hand, Walid Regragui's men claimed a second consecutive victory in Qatar by beating Canada 2-1 to finish top of Group F with seven points from a possible nine.
Here, Sports Mole looks at how the squads of Morocco and Spain weigh up against each other ahead of Tuesday's contest.
MOROCCO
Most valuable player:
Achraf Hakimi (£56.3m)
Overall squad value:
£209m
Most capped player:
Romain Saiss (69)
Leading goalscorer:
Hakim Ziyech (19)
Total caps:
568
Total goals:
73
Oldest player:
Munir Mohamedi (33)
Youngest player:
Bilal El Khannous (18)
Average age:
26.2
SQUAD IN FULL
Goalkeepers: Yassine Bounou (Sevilla), Munir (Al-Wehda), Ahmed Reda Tagnaouti (Wydad)
Defenders: Achraf Hakimi (Paris Saint-Germain), Noussair Mazraoui (Bayern Munich), Romain Saiss (Besiktas), Nayef Aguerd (West Ham), Achraf Dari (Brest), Jawad El Yamiq (Real Valladolid), Yahia Attiat-Allah (Wydad), Badr Benoun (Qatar SC)
Midfielders: Sofyan Amrabat (Fiorentina), Selim Amallah (Standard Liege), Abdelhamid Sabiri (Sampdoria), Azzedine Ounahi (Angers), Bilel El Khanouss (Genk), Yahya Jabrane (Wydad)
Forwards: Hakim Ziyech (Chelsea), Youssef En-Nesyri (Sevilla), Sofiane Boufal (Angers), Zakaria Aboukhlal (Toulouse), Abde Ezzalzouli (Osasuna), Anass Zaroury (Burnley), Ilias Chair (Queens Park Rangers), Abderrazak Hamdallah (Al-Ittihad), Walid Cheddira (SSC Bari)
SPAIN
Most valuable player:
Pedri (£86.6m)
Overall squad value:
£760.0m
Most capped player:
Sergio Busquets (141)
Leading goalscorer:
Alvaro Morata (30)
Total caps:
780
Total goals:
88
Oldest player:
Sergio Busquets (34)
Youngest player:
Gavi (18)
Average age:
25.4
SQUAD IN FULL
Goalkeepers: Unai Simon (Athletic Bilbao), Robert Sanchez (Brighton), David Raya (Brentford)
Defenders: Cesar Azpilicueta (Chelsea), Dani Carvajal (Real Madrid), Eric Garcia (Barcelona), Hugo Guillamon (Valencia), Pau Torres (Villarreal), Aymeric Laporte (Manchester City), Jordi Alba (Barcelona), Jose Gaya (Valencia)
Midfielders: Sergio Busquets (Barcelona), Rodri (Manchester City), Gavi (Barcelona), Carlos Soler (Paris St-Germain), Marcos Llorente (Atletico Madrid), Pedri Gonzalez (Barcelona), Koke (Atletico Madrid)
Forwards: Ferran Torres (Barcelona), Nico Williams (Athletic Bilbao), Yeremi Pino (Villarreal), Alvaro Morata (Atletico Madrid), Marco Asensio (Real Madrid), Pablo Sarabia (Paris St Germain), Dani Olmo (RB Leipzig), Ansu Fati (Barcelona)
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
World Cup 2022: Morocco vs. Spain head-to-head record
World Cup 2022: Reasons for Spain to be confident of beating Morocco
World Cup 2022: Reasons for Morocco to be confident of beating Spain
World Cup 2022: Why to expect a Hakim Ziyech assist against Spain