Juan Mata was an unused substitute and David De Gea not considered due to injury as one of the favourites for the trophy suffered a second successive reverse after being hammered 5-1 by the Netherlands last Friday.
Chile started brightly, almost scoring from their first attack, and maintained an incredible level of intensity in their play. Eduardo Vargas edged the South Americans in front with a calmly-taken finish following a slick move, touching the ball past Iker Casillas and finding the net as Sergio Ramos closed in.
A second goal arrived two minutes before the interval when livewire Alexis Sanchez's free-kick was straight at Casillas but the Spanish captain only punched it away and Charles Aranguiz returned it past the keeper's left hand.
Spain coach Vicente del Bosque preferred Koke to Mata as Xabi Alonso's half-time replacement and, after Sergio Busquets missed a sitter, Fernando Torres was his second substitute. Roared on by the majority of the near-74,000 crowd, Chile stuck to their task manfully.
Mauricio Isla could not keep an effort down at full stretch, with the goal gaping, and Mata was kept waiting for an appearance in Brazil as Arsenal's Santi Cazorla came on for Pedro. Claudio Bravo denied Andres Iniesta with a top-drawer save with time running out as Chile clinched a famous victory to join the Netherlands, who have also now qualified, on six points in Group B.