Ronaldo opened the scoring with a first-half penalty and then earned a point with a second spot-kick after Karim Benzema’s strikes either side of half-time had seen the French come from behind to lead.
Ronaldo’s goals - the 108th and 109th of his Portugal career - saw the Juventus star draw level with Ali Daei’s all-time international goalscoring record and took his tally for the tournament to five.
The result means France top Group F and will face Switzerland in the last-16, while Portugal finish as one of the four best third-placed teams and now face a tough tie against Belgium. Germany, who finished second after drawing 2-2 with Hungary in Munich, will play England at Wembley.
Ronaldo was handed his first opportunity from 12 yards when Hugo Lloris clattered midfielder Danilo while trying to claim a high free-kick and the Portuguese skipper made no mistake.
France had been below par but were gifted a leveller in first-half stoppage time when Benzema converted from the spot after Nelson Semedo had been harshly penalised for a foul on Kylian Mbappe.
Benzema struck again immediately after the restart, slotting home via the post after being brilliantly found by Paul Pogba, and though the goal was initially ruled out for offisde, VAR confirmed the Real Madrid striker had been level.
Portugal’s second penalty came about when Jules Kounde was adjudged to have handballed Ronaldo’s attempted cross and once again Lloris was well-beaten by the resulting spot-kick.
France went closest to winning it, with Rui Patricio producing a brilliant double save to deny both Pogba and Antoine Griezmann, but as news filtered through of Germany’s equaliser against Hungary in the group’s other fixture, both sides were happy to see out the final minutes with qualification assured.