Italy broke a 22-year hoodoo to end Spain's bid for a record third successive European title with a deserved 2-0 win in their last 16 clash between the two heavyweights at Euro 2016.
Italy triumphed with goals from Giorgio Chiellini and Graziano Pelle and will face Germany in the quarter-finals.
The Italians, who had not won a competitive match against Spain since the 1994 World Cup and were humiliated 4-0 by their old rivals in the Euro 2012 final in Kiev, were the better side, especially in the first half, on a damp evening.
Italy, who were better organised and more aggressive before the break, had wasted several chances when defender Chiellini put them ahead after 33 minutes, following up to tap in after goalkeeper David De Gea failed to block Eder's free kick.
The Italians suffered in the second half and had been resisting sustained Spanish pressure when striker Pelle connected with a Matteo Darmian cross to volley home from close range, douubling their advantage in added time.
Spain's defeat marked the end of an era for a side who had established themselves as the dominant force in Europe by winning the European Championship in 2008, after knocking out Italy in the quarter-finals, and repeated the success in 2012.
The Spaniards, who struggled to impose their trademark, quick passing game on a slippery pitch, had already suggested they were on the way out when they lost their world crown with a shock group-stage exit from the 2014 World Cup in Brazil.
Italy, who had won one of their past 11 games against Spain and whose ageing side had been written off by many in the build-up to the tournament, face Germany on Saturday in Bordeaux in another battle of the heavyweights for place in the semi-finals.
Chiellini's goal was the first conceded by Spain in the knockout stages of a European championship or a World Cup since a 3-1 defeat by France in the last 16 of the 2006 World Cup.