Slovakia stunned Spain 2-1 in European Championship qualifying on Thursday, breaking the run of 14 straight away wins for the titleholder.
It was Spain's first away loss in qualifying for the European Championship and the World Cup since 2006.
Spain goalkeeper Iker Casillas let the opener by him in the 17th minute when he failed to punch out Juraj Kucka's free kick. Paco Alcacer leveled for Spain in the 82nd, but fellow substitute Miroslav Stoch headed a cross past Casillas in the 87th with Spain caught looking for the winner.
Slovakia took the lead of Group C, where Besart Abdurahimi scored in injury time to grab Macedonia a 3-2 win at home over Luxembourg, while Ukraine won 2-0 at Belarus. Defender Aleksandr Martynovich scored an own goal in the 82nd to gift Ukraine the lead before Serhiy Sydorchuk added another goal in stoppage time.
Striker Diego Costa has nine goals in as many games for his Chelsea club, but he again failed to find the net in his sixth appearance for Spain despite generating its best chances. After exiting the World Cup by losing its first two matches, Spain bounced back with a rejuvenated team to thrash Macedonia 5-1 in its first Euro 2016 qualifier.
But the same problems in Brazil returned at Slovakia: Casillas, once considered among the best in the world, again let a shot that was powerful but stoppable past him. Costa couldn't mesh with Andres Iniesta and David Silva in the tight spaces Spain's passing game causes, and its defense proved brittle when faced with counterattacks.
Despite fielding a starting 11 who all played at the World Cup, it fell to Alcacer to score his second goal in as many games to finally break through Slovakia's defense when he timed his move to stay onside and reach Jordi Alba's lobbed pass. Coach Vicente del Bosque sent Alcacer and Pedro Rodriguez on in the second half at the cost of pulling Raul Albiol and playing with a three-man defense.
The decision led to the equalizer but also left Spain undermanned when Stoch played a one-two with Marek Hamsik before beating Santi Cazorla to head home a cross for the winner that sent the home crowd into raptures.
Casillas was both at his best and his worst early in the match. He was caught wrong-footed but reacted in time to make a superb one-handed save of Robert Mak's strike in the 11th. But moments after Costa headed Cesc Fabregas' pass by the bottom of the post, Casillas made an error in Slovakia's opener that was rare to see before his poor displays in Brazil.
Casillas misjudged the free kick Kucka struck hard but right at him, falling to one side and letting the strike glance off his fists and hit his net. Spain didn't force Slovakia goalie Matus Kozacik into action until the 38th when he got low to parry Iniesta's dipping effort. Kozacik then made saves to deny Costa, Sergio Busquets and Fabregas on either side of halftime.
Spain can take solace that the top two from the nine groups qualify automatically for the tournament in France. The best third-placed team also qualifies automatically, and the other eight teams can qualify through a playoff. Spain visits Luxembourg on Sunday, while Slovakia visits Belarus.