Spain's famed passing game failed against a high-tempo, tenacious Chile team, its era ending in the storied Maracana Stadium filled mostly with Chilean supporters.
Eduardo Vargas tricked goalkeeper Iker Casillas into diving the wrong way, then shot into an unguarded goal in the 20th minute. Charles Aranguiz scored in the 43rd when the ball landed at his feet after Casillas punched out a free kick.
Spain's second loss, after a 5-1 rout by the Netherlands, ended any hope of advancing. Chile and the Netherlands will both advance, regardless of who wins the game between them.
Spain won the European Championship in 2008 and 2012, in addition to the 2010 World Cup.
Spain came to Brazil with a very similar - but older - team than the one that won those titles. They added Brazilian-born striker Diego Costa, but he failed to score a goal.
Their ''tiki-taka'' style of play - keeping the ball for long stretches with short passes, and only shooting when you had a clear opening - had not been working as well in recent years. Brazil defeated Spain 3-0 in last summer's Confederations Cup, a warm-up for the World Cup.
Spain became the third straight European defending World Cup champion to flop in the group stage. France in 2002 and Italy four years ago also failed to advance, or even win a match.
Badly needing a win, del Bosque stayed loyal to captain Casillas despite the veteran goalkeeper's errors against the Dutch.
Two pillars of Spain's title runs, Barcelona pair Xavi Hernandez and Gerard Pique with a combined 194 appearances, were left out.
Xabi Alonso probably should have joined them. His agonising first half typified Spain's problems and his errors led to both goals.
And Alonso's selection left a younger version of his former self, Atletico Madrid's Koke, on the bench until the logical change was made at half time.
Alonso gave away the ball to Alexis Sanchez to start a move down Chile's right wing by Arturo Vidal and Aranguiz, leading to Vargas' score. Alonso trailed behind the play and put his hands to his head.
Alonso was booked in the 40th before conceding another foul, on Sanchez, three minutes later 22 yards (meters) out.
When Casillas punched away Sanchez's curling free-kick, Aranguiz trapped the ball then flicked a rising shot spinning away from the goalkeeper's reach.
Alonso had Spain's best early chance, a 15th-minute shot smothered by Chile goalkeeper Claudio Bravo.
Often wayward in its passing, Spain missed two clear chances early in the second half.
Costa was slow on Andres Iniesta's threaded pass in the 49th, and Sergio Busquets was guilty of a glaring miss, volleying wide from five meters in the 53rd.
After Bravo pushed away shots by substitute Santi Cazorla and Iniesta, Chile's win was sealed.