Former teammates Cristiano Ronaldo and Karim Benzema each had a brace as Portugal and France finished up their Group F schedule with a 2-2 draw in Budapest.
Ronaldo's two goals, both penalties, tied the all-time men's record for international goals, while Benzema's brace were his first goals in a France shirt in six years.
Controversy was the name of the game in the first half.
After a mostly uneventful first half hour, things changed with a swinging free kick into the France area. Portugal midfielder Danilo went up for the header as France 'keeper Hugo Lloris came off his line to attempt to clear it. The PSG man made it to the ball first and his header went directly into the fist of Lloris, who was too slow to the ball. The issue was Lloris' follow-through. After first meeting the ball, his fist met Danilo's face. Spanish referee Antonio Mateu Lahoz issued a yellow card - one of four given to Les Bleus in the first half - and point to the spot.
Cristiano Ronaldo made no mistake, beating Lloris for his fourth goal of the tournament and a 1-0 lead for the defending champions in the 30th minute. It was the Juventus man's first career goal against France.
But Lahoz would once again make his mark on the match only minutes later. In first-half stoppage, Paul Pogba attempted to loft a ball into the Portugal area for a chasing Kylian Mbappe. As Mbappe made his move, he was bumped to the ground by Portugal defender Nelson Semedo and Lahoz once again pointed to the spot.
Real Madrid's Karim Benzema beat Rui Patricio to tie the game at 1-1 with his first France goal since 2015.
After the restart, it would be Benzema - and controversy - again to take the spotlight. Taking another fine ball from Pogba, who was a menace all game long, Benzema slotted home past Patricio, but the linesman's flag immediately went up. After a VAR check, a good goal was given and France took the lead at 2-1.
The edge would be short-lived, though. In the 60th, Ronaldo's attempted cross into the area deflected off of Jules Kounde and up and onto his arm. Because his hand was in an unnatural position, Lahoz awarded a third penalty.
Ronaldo's second goal of the match would be a historic one. Beating Lloris a second time from the spot to tie the game at 2-2, Ronaldo's goal was his fifth in the group stage, becoming only the second man to achieve the feat after Michel Platini in 1982. More importantly, though, it was international goal No. 109, tying Iran striker Ali Daei for the most ever in men's football.
The result gave France five points and top spot in the group. They will now travel to Bucharest for a Round of 16 clash on Monday against Switzerland.
Portugal finishes third in Group F and now meets Belgium in Sevilla on Sunday.