Spain moved to the top of Euro 2016 Group C as they ended Slovakia's 100 percent record with a 2-0 win in Oviedo.
Slovakia had upset La Roja in Zilina last October at the start of the qualifying campaign, and could have all but secured their place in France next summer with a repeat victory.
However, after Robert Mak missed a great chance inside the opening four minutes, Vicente del Bosque's men went on to secure all three points following a workman like display, as a fine headed goal from Jordi Alba and a penalty by Andres Iniesta put the hosts in control at the Nuevo Carlos Tartiere.
Slovakia, with six straight victories heading into the tie, were gifted an early opportunity when Sergio Ramos lost the ball and Mak sprinted clear.
However, the PAOK forward could only drag his shot wide of Iker Casillas' goal, the Spain captain handed his 100th cap with David de Gea, who saw a proposed deadline day move from Manchester United to Real Madrid, starting on the bench.
It proved a costly miss as on five minutes, left-back Jordi Alba arrived on cue to head home a floated, angled ball into the Slovakia penalty area from David Silva.
Spain doubled their lead on 30 minutes.
Chelsea striker Diego Costa latched onto a chipped pass into the penalty area, and knocked the ball past the goalkeeper, before going to ground under what looked minimal contact.
Slovenian referee Damir Skomina, though, had seen enough, pointing to the spot, with Andres Iniesta stepping up to slot past Matus Kozacik.
The visitors looked to get back into the game before half-time, when Napoli midfielder Marek Hamsik forced Casillas into a smart save with a low effort after creating space outside the left of the Spain penalty area.
Silva was off target at the start of the second half after more positive play from the 2012 European champions.
Despite the home side's domination of possession, Casillas, who joined Porto in July from Real Madrid, had to remain alert as he tipped away a goalbound effort from Michal Duri.
With 20 minutes left, Silva wasted another chance to get on the scoresheet when he fired over after Costa's acrobatic kick dropped to him in the six-yard box at the far post.
Sergio Busquets drove a low 20-yard effort wide in stoppage time.
Spain travel to Skopje to face Macedonia on Tuesday, while Slovakia take on third-placed Ukraine.