The return of Vicente del Bosque's men to the scene of their World Cup 2010 triumph ended in disaster as they were on the receiving end of a shock defeat.
South Africa deserved to win at Soccer City in Johannesburg, with Vicente del Bosque's side disjointed throughout, rarely testing Itumeleng Khune in the home goal.
After a first half of few chances, Bernard Parker struck the only goal of the game, latching on to a through ball and finishing well, Nacho Monreal unable to save his side despite an acrobatic attempted clearance.
Goalkeeper Victor Valdes had entered the game at halftime, 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 the only man retained, while four of South Africa's XI from a 3-0 triumph over Swaziland were again picked by Gordon Igesund.
Spain looked to exploit the home side's high defensive line with David Villa finding the net twice in the opening seven minutes, only to be denied by the offside flag.
South Africa grew in confidence after the 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 that deflected off Sergio Ramos and looped over a stranded Iker Casillas but bounced over via 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 wide of 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 home team which 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 with Monreal unable to prevent the goal.
A raft of substitutions seemed to have only further dented Spain's fluidity and there was cause for concern as Valdes was forced off with 15 minutes to go, appearing to injure his knee in innocuous circumstances.
Pepe Reina became Spain's third keeper of the night, after a lengthy delay as South Africa fumed over the Spain's attempts to use a seventh change of the game.
Del Bosque could only watch on as his side failed to draw level, Khune denying Raul Albiol's toe-poked effort in the last minute of stoppage time as Spain slipped to its first loss since July's 3-0 FIFA Confederations Cup final defeat to Brazil.