Uruguay bowed out of the World Cup as goalkeeper Fernando Muslera's howler gifted Spain a 1-0 win in Guadalajara to secure top spot in Group H.
Alex Baena's weak shot slipped through Muslera's grasp for the only goal as Spain avoided a last 32 showdown against Argentina.
The European champions will instead face Austria or Algeria next in Los Angeles on Thursday.
Uruguay's defeat allowed debutants Cape Verde to secure second place and a meeting with Lionel Messi and the defending champions thanks to a 0-0 draw against Saudi Arabia.
Two-time winners Uruguay become the highest ranked side to crash out in the group stages as the defeat rounded off a miserable tournament for Marcelo Bielsa and his squad.
Hyped as one of the pre-tournament favourites, Spain are now 34 competitive games unbeaten and are yet to concede a goal at the World Cup.
But in stark contrast to some of the scintillating attacking play on show from the likes of France, Argentina and the Netherlands, La Roja are yet to convince in their quest for a second World Cup triumph.
After draws against Cape Verde and Saudi Arabia, reports of a revolt in the Uruguay camp emerged with leading players, including Real Madrid's Federico Valverde, clashing with Bielsa over his tactics.
Cape Verde completed an improbable run through the group stage with a third straight World Cup draw to become the smallest country to earn a spot in the knockout round following a 0-0 draw against Saudi Arabia on Friday night.
The small island nation off the western coast of Africa, which is making its debut on soccer's grandest stage, already held 2010 champion Spain to a 0-0 draw and then came from behind to get a 2-2 result against Uruguay.
Cape Verde's three points put the team in second place behind Spain, which beat Uruguay on Friday night and won the group.
Cape Verde will play reigning World Cup champion Argentina in Miami on July 3.
Drawing all three group matches does not guarantee advancement at major soccer tournaments. But several teams have done it in the past, including Wales in 1958, Ireland and the Netherlands in 1990, and Chile in 1998. New Zealand, however, also got three draws at the 2010 World Cup and was eliminated.
(FRANCE 24 with AFP, AP)


I’ve put Uri Gellar in a bottle for challenging his spiritual powers – Kwaku Bon...
GCB Board Chairman Prof. Joshua Alabi promises $100,000 winning bonus for Black ...
President Mahama cuts sod for 24-hour economy market at Assin Bereku
Big Push projects have slowed down because of heavy rainfall — Mahama
Police probe suspected foul play after woman found hanging dead in Somanya
GARID project to be completed by December 2027 to tackle Accra flooding – Housin...
I've lifted the curse I placed on Harry Kane – Kwaku Bonsam
Mahama begins Central Region Resetting Ghana Tour
2026 not a year for major public sector salary renegotiations – Vice President O...
Govt to introduce new rent law to strengthen tenant protection