Spain 2 Greece 1: A second string Spain side came from a goal down to beat 2004 champions Greece in their final Group D game.
Daniel Guiza headed the winner two minutes from time when he met a cross from Sergio Garcia to hand a third straight defeat to already eliminated Greece.
The Greeks had taken the lead late in the first half through a header from striker Angelos Haristeas but midfielder Ruben de la Red equalised just after the hour.
With Spain resting almost their entire first-choice side ahead of their quarter-final showdown against Italy on Sunday and Greece playing for little more than pride, the game lacked the intensity and edge of the previous group clashes.
Spain had an early chance when De la Red sliced wide and Xabi Alonso almost caught Greece keeper Antonis Nikopolidis out when he launched a long-distance drive from inside his own half.
Alonso shaved the post with two more firm drives, but it was Greece who broke the deadlock and took the lead against the run of play three minutes before half-time.
The unmarked Haristeas outjumped the Spain defence and sent a powerful header spinning past keeper Pepe Reina to score his side's first goal of the tournament after midfielder Giorgios Karagounis had clipped a free kick into the area.
The Greek players ran down the pitch to celebrate with keeper Nikopolidis who had been given the captain's armband in honour of his last match before his international retirement.
Alonso almost scored when he hammered a 25-metre drive against the post early in the second half, but it was De la Red who equalised with his first goal for Spain.
He blasted home after Dani Guiza had headed back a long pass from Cesc Fabregas into his path just after the hour.
Guiza then got on the scoresheet himself with his first goal for his country with a powerful header past Nikopolidis to extend Spain's winning run to nine games.
If the Spanish reserves saw the game as a chance to break into the line-up against Italy, however, most of them failed to take the chance with Fabregas and Alonso the only players other than first-teamer Andres Iniesta to show any spark.