Cristiano Ronaldo scored twice as Portugal registered a 3-3 draw against Hungary on Wednesday to earn a place in the knockout stages at Euro 2016.
Zlotan Gera opened scoring for Hungary in the 17th minute but Nani equalised three minutes before half-time.
Hungary went ahead again through Balazs Dzsudzsak in the 47th minute.
Ronaldo, who struggled in the first two games, finally broke his Euro 2016 duck with a brilliant flick in the 55th minute to make it 2-2.
Dzsudzsak made it 3-2 for Hungary but Ronaldo once again came to Portugal's rescue with the final equaliser.
Portugal came from behind on three occasions but it was only enough for third place after Iceland scored a 94th-minute winner against Austria in Paris for a 2-1 win.
That goal leaves Hungary topping Group F, while Portugal will have to make do with a clash with Croatia in Lens on Saturday night.
Iceland finished second and set up a round of 16 clash with England.
4years ago My wife left me,because i was too WEAK in bed,but today she calls me Bed Champion.Now i finally discovered a Natural Solution that forces women to ask for more. " - CLICK HERE To See My Breakthrough. Men, eat this fruit & you will get a bigger penis size. How I Permanently Cured My Premature Ejaculation And Low Sperm Count Problem Without Any Side Effects Within 72hrs.And Confidently Last Over 35 Minutes Per Round In Bed.