Spain, who had opened their Euro 2016 campaign with a 5-1 mauling of Macedonia, exhibited all the faults which had led to their World Cup humiliation as Slovakia went top of Group C with a perfect six points.
Former Chelsea midfielder Miroslav Stoch, now plying his trade at Al Ain in the UAE, struck three minutes from time in Zilina to condemn Vicente Del Bosque's team to a first qualifying defeat since 2006, a streak lasting 36 matches.
But with just three minutes left Slovakia launched a counter-attack as captain Marek Hamsik played substitute Michal Duris down the inside right to cross for Stoch to head home at the back post.
At a subdued Wembley, England made it two wins from two with a routine 5-0 defeat of whipping boys San Marino.
More From This Section
Wayne Rooney took his international goal tally to 42 and forced Alessandro Della Valle into a late own goal, while Phil Jagielka, Danny Welbeck and substitute Andros Townsend also found the target.
"Job well done," said England manager Roy Hodgson. "The crowd were fantastic. They've had an enjoyable night. We could have had more, but I can't fault the players. I'm really pleased.
"At 5-0 when we lost the ball, we had three or four players sprinting back to win the ball back. That type of desire is very commendable.