Ricardo Quaresma scored late in extra time as Portugal defeated Croatia to set up a Euro 2016 quarter-final match against Poland.
The substitute headed in from two yards after keeper Danijel Subasic could only palm Cristiano Ronaldo’s shot into the path of the Besiktas winger.
The contest was a turgid affair for much of the 120 minutes.
Croatia’s Domagoj Vida and Marcelo Brozovic went close with headers, and Ivan Perisic’s effort hit the bar.
Portugal’s last-eight match will take place at the Stade Velodrome in Marseille on Thursday.