Match ends, Portugal 2, France 2.
Cristiano Ronaldo equalled the men's all-time international goalscoring record as defending champions Portugal drew with France to qualify for the last 16 of Euro 2020 as one of the best third-placed teams.
Ronaldo scored his 108th and 109th goals, both from the penalty spot, to equal Ali Daei's record set with Iran between 1993 and 2006.
They came either side of half-time but were not enough to give Portugal victory as striker Karim Benzema broke a six-year goal drought with France to score twice and ensure Les Bleus topped the group.
On a frantic evening, the four teams in Group F changed positions frequently, with Portugal looking set to face England in the next round before Germany's dramatic late equaliser bumped them from fourth to second and eliminated Hungary.
Ronaldo gave Portugal the lead after Hugo Lloris followed through on Danilo as he attempted to punch away a cross, before Benzema equalised on the brink of half-time after Nelson Semedo was adjudged to have blocked off Kylian Mbappe's run in the box.
Benzema scored a second immediately after the restart following a stunning pass from Manchester United's Paul Pogba but Ronaldo drew Portugal level when he won and converted a second penalty 13 minutes later.
The draw in Munich meant Portugal finished in third place based on a head-to-head record, while France topped the group, a point ahead of Germany.
- Ronaldo equals international goals record
- Reaction to Portugal's draw with France
- Daily Euros podcast: Ronaldo and Benzema set the Euros alight
Ronaldo-inspired Portugal show real threat
The match was teed up as a battle of giants and Ronaldo produced the goods as one of the biggest.
His first goal saw him become the outright European top scorer at major tournaments with 20 - overtaking former Germany striker Miroslav Klose - and his second equalled Daei's record.
He now has 48 goals in his past 45 matches for Portugal and, with five goals in three matches so far at Euro 2020, he leads the race for the Golden Boot.
Portugal face another tough test in the next round, with world number one side Belgium waiting in the last 16, but they showed their threat in this draw with world champions France.
Ronaldo's ability to score when it matters was demonstrated once again, while experienced defender Pepe showed his guile at the back to thwart Mbappe.
Goalkeeper Rui Patricio also made a vital contribution - brilliantly denying Pogba from long range with a fingertip save, before recovering to palm away Antoine Griezmann's rebound effort in the second half.
Portugal quietly went through the rounds in 2016 before lifting the title and despite a sometimes nervous night in Budapest they remain a threat as the tournament moves into the knockout stages.
France's Benzema earns Ronaldo's respect
If Ronaldo stole the show in his usual fashion, it was former Real Madrid team-mate Benzema who denied the defending champions a place at the top of the table.
Benzema, who last scored for France in October 2015, showed composure to smash in the equaliser from the spot in the first half - even receiving a pat on the back from Ronaldo as he returned to the centre circle.
The pair hugged at half-time as they walked off the pitch deep in conversation but Benzema showed no mercy when the teams returned from the break, sliding home France's second from Pogba's inch-perfect pass.
The teams were level again after Ronaldo chipped it on to the outstretched arm of Jules Kounde to win Portugal's second penalty but France could still have won it later on when Pogba and Griezmann forced the smart double-save from Patricio.
Mbappe was a nuisance without scoring again, Pogba produced moments of quality and in Benzema, France have a world-class striker.
They take on Switzerland in Bucharest on Monday and will remain one of the hot favourites for the competition.
- 1Rui Patrício
- 2Nélson SemedoSubstituted forDalotat 79'minutes
- 4Rúben Dias
- 13DaniloSubstituted forAlves Palhinha Gonçalvesat 45'minutes
- 10Bernardo SilvaSubstituted forBruno Fernandesat 72'minutes
- 8João MoutinhoSubstituted forNevesat 73'minutes
- 16Renato SanchesSubstituted forOliveiraat 88'minutes
- 7Cristiano Ronaldo
- 6José Fonte
- 9André Silva
- 11Bruno Fernandes
- 14William Carvalho
- 15Ferreira Silva
- 22Dantas da Silva
- 26Alves Palhinha Gonçalves
- 1LlorisBooked at 27mins
- 3KimpembeBooked at 83mins
- 21HernándezBooked at 36minsSubstituted forDigneat 45'minutesSubstituted forRabiotat 52'minutes
- 12TolissoSubstituted forComanat 66'minutes
- 7GriezmannBooked at 39minsSubstituted forSissokoat 87'minutes
- 22Ben Yedder
- Antonio Miguel Mateu Lahoz
- Shots on Target
Second Half ends, Portugal 2, France 2.
Jules Koundé (France) wins a free kick in the defensive half.
Foul by Sérgio Oliveira (Portugal).
Substitution, Portugal. Sérgio Oliveira replaces Renato Sanches.
Substitution, France. Moussa Sissoko replaces Antoine Griezmann.
Attempt missed. Antoine Griezmann (France) left footed shot from outside the box is high and wide to the left. Assisted by Kingsley Coman.
Presnel Kimpembe (France) is shown the yellow card for a bad foul.
Foul by Presnel Kimpembe (France).
Cristiano Ronaldo (Portugal) wins a free kick in the defensive half.
Kingsley Coman (France) wins a free kick on the right wing.
Foul by Renato Sanches (Portugal).
Offside, France. Kylian Mbappé tries a through ball, but Adrien Rabiot is caught offside.
Substitution, Portugal. Diogo Dalot replaces Nélson Semedo because of an injury.
Attempt blocked. Antoine Griezmann (France) left footed shot from outside the box is blocked. Assisted by Kingsley Coman.
Substitution, Portugal. Rúben Neves replaces João Moutinho.
Substitution, Portugal. Bruno Fernandes replaces Bernardo Silva.
Attempt missed. João Palhinha (Portugal) right footed shot from outside the box is too high. Assisted by Bernardo Silva.
Attempt missed. Karim Benzema (France) right footed shot from outside the box misses to the right. Assisted by Paul Pogba.
Hand ball by Renato Sanches (Portugal).