Spain must now beat Italy in a rematch of the 2012 final to remain in contention for a record third successive European Championship title after sliding to defeat against Croatia in Bordeaux. Turkey beat Czech Republic 2-0 in the day's other Group D game.
“It was not the desired route for us,” said Spain coach Vicente Del Bosque.
“That is football, it seemed like we had the game controlled, but in football you can't take anything for granted.
“We will try to recover from this disappointment and prepare for Monday.”
Tuesday's results also mean that Slovakia, Hungary and Northern Ireland are all guaranteed to reach the knockout stages.
Spain just needed to avoid defeat to secure top spot in Group D. Alvaro Morata grabbed a seventh minute goal that should have had Spain cruising towards a last-16 tie against a third-placed team.
Example to fans
Despite the absence of injured Real Madrid star Luka Modric, Croatia fought back. Nikola Kalinic flicked home an equaliser on the stroke of half-time.
Spain captain Sergio Ramos then saw his second-half penalty saved by Danijel Subasic, and it cost his side dearly as Perisic struck a winner three minutes from time to fire Croatia through in first place.
Croatia coach Ante Cacic said the footballers' heroics should be an example to their unruly fans who have brought the threat of sanctions on the country for their flare-throwing abuse.
“These players are showing how you have to represent and play for your country and how you have to behave,” he said.