Spain left Johannesburg with their tails between their legs after falling to a stunning 1-0 loss to South Africa.
The home side were deserving winners at Soccer City, with Vicente del Bosque's side disjointed throughout.
After a first half of few chances, Bernard Parker struck the only goal of the game after latching on to a through ball and finishing well.
Goalkeeper Victor Valdes had entered the game at half-time, but was forced from the pitch with a painful looking knee injury that forced him from the field.
Del Bosque made 10 changes to the side that edged past Equatorial Guinea 2-1 on Saturday. Xabi Alonso was the only man retained, while four of South Africa's XI from their 3-0 triumph over Swaziland were again picked by Gordon Igesund.
Spain looked to exploit the hosts' high defensive line with David Villa finding the net twice in the opening seven minutes - only to see both efforts ruled out by the offside flag.
South Africa grew in confidence after their shaky start and almost took the lead through Oupa Manyisa in the 17th minute.
The Orlando Pirates midfielder picked the ball up 30 yards out and crashed an effort at goal, with his shot deflecting off Sergio Ramos and striking the crossbar.
After a promising start, the half fizzled out into a scrappy affair with Alonso whipping a low free-kick wide and Bongani Khumalo crashing a header past the near post with the last action of the opening period.
Tokelo Rantie blazed a gilt-edged chance over two minutes into the second period, while Andres Iniesta brought a smart save from Khune, but it was the hosts who took a shock lead in the 56th minute.
Thabo Matlaba burst up the left wing before neatly finding Parker, who dinked over substitute goalkeeper Valdes.
A raft of substitutions seemed to have only further dented Spain's fluidity and there was further cause for concern as Valdes was forced off with 15 minutes to go, as he appeared to injure his knee under no pressure from an opponent.
Pepe Reina became Spain's third keeper of the night, after a lengthy delay as South Africa fumed over the visitors' attempts to use a seventh change of the game - the most permitted for a friendly is six.
Del Bosque could only watch on as his side failed to draw level, with Khune denying Raul Albiol's toe-poked effort in the last minute of stoppage time as Spain slipped to their first loss since July's 3-0 Confederations Cup final defeat to Brazil.
for D. Claasen 46'
for B. Khumalo 46'
for A. Jali 50'
for O. Manyisa 63'
for B. Parker 90+3'
|Russia confirm Slutsky resignation|
|Pirlo: Italy out for Spain revenge|
|Vokes consoles McAuley after Wales march on|
|Italy-Spain a battle of world´s best - Llorente|
|Messi one win away from becoming the greatest|
|Play-offs the goal as Baptista settles into life in Orlando|
|Colombia closer to winning titles - Pekerman|
|MLS Review: Kaka scores 100th-minute penalty in thriller, Lampard inspires NYC|
|Portugal ´don´t have a clue how they scored´ – Rakitic|
|Klinsmann: USA should be proud of Copa America display|
|United States 0 Colombia 1: Bacca secures third place at Copa America|
|Corluka: Portugal among worst teams at Euro 2016|
|Sanches happy to be involved as Portugal reach quarters|
|Euro 2016 Diary: Shaqiri rivals Pique for Shakira´s affection, Bale reveals secret weapon|
|Morata: I have nothing to prove to Zidane|
|Di Maria fit for Copa final|
|´You do not always win by playing prettily´ - Santos unconcerned by dour Portugal|
|The best team lost, says disconsolate Cacic|
|Fabianski: Poland must create more for Lewandowski|
|McAuley pride after crushing Wales loss|
|Ronaldo takes one for the team as Portugal emerge from drudgery in Lens|
|Croatia 0 Portugal 1 (aet): Quaresma earns quarter-final berth|
|Hodgson will not beg for FA approval after Euro 2016|
|Emotional Bale glad to share Paris joy with family|
|O´Neill left frustrated by officials following Euro 2016 exit|
|Coleman hails Bale brilliance in Wales win|
|Low relying on Kroos to lead Germany the way|
|Italy v Spain: Thiago denies shirt jinx ahead of Azzurri clash|
|O´Neill: McAuley has been magnificent|
|Szczesny thanks Swiss fans for drink|
|Hector: Slovakia have plenty of quality in attack|
|Morata: Italy defenders have told me to wear a helmet|
|Coleman content with scrappy Wales progression|
|Wales remain and Northern Ireland leave after Paris battle|
|We are free of pressure - Gera|
|´Do I look like I have doubts?´ - Defiant Nawalka defends Lewandowski|
|Wales 1 Northern Ireland 0: McAuley´s woe is Welsh joy|
|No chance Barcelona star Neymar will join Madrid, says his father|
|Witsel happier to face Hungary than Spain|
|Wilmots accepts pressure ahead of Hungary test|
|Slovakia can upset Germany again - Pekarik|
|Shaqiri unhappy with Poland celebrations after Euro 2016 exit|
|Grosicki struggled to watch Poland shootout win|
|Poland need Lewandowski to rediscover ruthless streak|
|Switzerland 1 Poland 1 (aet, 4-5 pens): Xhaka shocker costs Swiss after Shaqiri magic|
|Payet can handle hero status - Deschamps|
|Redmond joins Southampton on five-year deal|
|Sturridge: Sterling unfairly targeted over England performances|
|Wilmots: I want more from smiling De Bruyne|
|Croatia star Perisic unveils latest wacky hairstyle|
|Brazil´s Lucas Lima wants European move|
|Lloris tempers talk of Ireland revenge mission|
|Deschamps refuses to make France ´98 comparisons|
|O´Neill confident Ireland can shock France|
|Chiellini will give Morata a few kicks - Barzagli|
|England v Iceland: Rooney targets early goal|
|Italy´s Candreva ruled out of Spain match|
|Butland ready for pre-season after scan gives goalkeeper all-clear|
|Origi not underestimating Hungary|
|Plans drafted for Old Firm games to be played abroad|
|Boost for Germany as Boateng trains ahead of last 16|
|I never saw Ronaldo look in the mirror! - Ancelotti|
|Fabregas fears Brexit will damage Premier League|
|Roy not keen on Ireland allocation|
|Dyke backs Hodgson for new contract|
|Spain not as aggressive as 2012, claims Ancelotti|
|Ronaldo and Messi need each other – Ancelotti|
|Juve on the same level as Madrid and Barcelona - Dybala|
|Fabregas: Conte´s Italy will be tough|
|Argentina v Chile: New year, same Copa finalists|
|Ronaldo ´cannot be the whole of Portugal´ - Shilton|
|Messi: Neymar is an amazing person|
|Pekerman keen to finish Copa on high note|
|Rakitic: Ronaldo won´t sleep easily|
|Messi: Now is not a time to give nothing|
|Courtois expects to leave Chelsea in future|
|Less rest no problem for Portugal - Joao Mario|
|Euro 2016 Diary: Benteke rap and Nelly the elephant|
|Santos: Group-stage performances behind Portugal|
|Cacic: We cannot let Ronaldo show his strength|
|O´Neill hopes to blow Bale off course|
|Coleman impressed with Ramsey´s discipline|
|O´Neill fires derby passions ahead of Wales showdown|
|Coleman: Take emotion out of Northern Ireland clash|
|LFP sanctions six Nice players for flouting gambling rules|
|Hungary v Belgium: Lukaku targets last-four spot|
|Dyke hopes Brexit can help England youngsters|
|No favourites against Italy, says Koke|
|Krychowiak not thinking about PSG as Poland stand by Lewandowski|
|World Cup qualifying: Algeria, Cameroon and Nigeria drawn in same group|
|Brexit may damage Premier League´s pursuit of young European players|
|Germany v Slovakia: Weiss confident of repeat Augsburg success|
|France v Republic of Ireland: Long not on Henry revenge mission|
|Chelsea midfielder Baker extends Vitesse loan|
|Chiellini concerned over Brexit ´domino effect´|
|Staying in Euro 2016 gets Coleman´s vote|
|Nainggolan has a room with a balcony so he can smoke - Wilmots|
|Petkovic attempts Poland mind games|
|Wilmots would rather play Spain than Hungary|
|Morata deserves more than being a Madrid bargaining chip - Chiellini|
|AZ want record fee for Janssen|
|What does Brexit mean for European football?|
|I´m not tired, I feel sharp - Kane hits back at critics|
|Delighted Kiyotake hopes to prove his value|
|Premier League confident Brexit will not diminish its success|
|Neuer wary of Hamsik´s long-range shots|
|Genesio: Lyon do not have to sell|
|Morata thanks Juventus fans after Real Madrid return|
|Lapadula undergoes AC Milan medical|
|Santos: Not everything revolves around Ronaldo|
|Icelandic chihuahua prepares to chase the England rhino|
|Jakupovic signs new Hull City contract|
|Lagerback: Brexit will not affect England team|
|ES Setif disqualified from CAF Champions League|
|Gerland sees Kimmich as Lahm´s long-term successor|
|Navas ´recovering nicely´ from heel injury|
|Messi excited by future Barcelona challenges|
|Conte´s Italy like Atletico and Barcelona, says Xavi|
|Zidane the man to take Madrid forward, says Baptista|
|United States v Colombia: Hosts out to end Copa America on a high|
|Aubameyang: It´s my dream to play in Spain|
|Wenger not interested in France job|
|Ronaldo: Euro 2016 surprises end now for Portugal|
|Coke hopeful Sampaoli can exceed Emery at Sevilla|
|Maradona: Portugal too dependent on Ronaldo|
|´What a disaster´ - Messi takes aim at AFA|
|Guidetti: Nolito will thrive at City|
|Wanyama thanks Southampton fans following Spurs switch|
|Kranjcar: Rangers can push Celtic all the way|
|Euro 2016 Diary: Icelandic heaven and Rooney not feeling the love|
|Wenger respects Vardy, talks up Kante|
|Rooney wants to end ´disappointing´ tournament record for England|
|Di Maria in serious doubt for Copa America final|