Still waiting for their first goal from open play in five games at this summer's finals, Didier Deschamps' side came closest through Randal Kolo Muani and then captain Kylian Mbappe, who was later forced off by injury.
Both Pepe and Ruben Dias made vital blocks, while Mike Maignan also produced some important saves at the other end; but extra time seemed inevitable, and during the added 30 minutes both teams were cautious not to concede.
After the first five penalties found the net, including another immaculate conversion from Portugal captain Cristiano Ronaldo, Joao Felix was the unfortunate fall guy, striking the post and handing Les Bleus an advantage they would not relinquish.
Theo Hernandez won it by nervelessly firing his spot-kick into the top corner, sparking celebrations on a relieved French bench and perhaps heralding the end of Ronaldo's long career on the international stage.
HIGHLIGHTS
12th min: Played in by Rafael Leao, Nuno Mendes drives down the left flank at top speed, but his early cross flashes across the face of goal and Cristiano Ronaldo cannot reach it.
14th min: Under pressure from the lurking figure of Ronaldo, Mike Maignan errs and bundles the ball over the right byline. Making up for his mistake, France's goalkeeper comes out and claims following the subsequent corner kick.
17th min: Allowed to take aim from around 20 yards out, Bruno Fernandes unleashes a curling shot towards the target. It deflects of Saliba, though, and travels behind for another Portugal corner.
20th min: Left in space on the left side of the area, Theo Hernandez drops the hammer on one of his customary strikes from outside the box; Portugal's last-16 hero Diogo Costa is equal to it, making a firm parry away!
23rd min: Kylian Mbappe bursts to the left byline, before attempting to cut the ball back into the six-yard box. Once again, Costa is alert, and gets a glove on the French captain's threatening cross.
25th min: Ronaldo is back on defensive duty, heading away Griezmann's curling free-kick from the right flank.
34th min: Griezmann takes France's first corner of the game, playing a one-two with Kounde. His delivery into the box meets Randal Kolo Muani arrives at the back post, but the latter plays safe and Les Bleus just recycle possession.
41st min: Kolo Muani clumsily brings down Vitinha on the edge of France's area, and Ronaldo inevitably shapes up to take the free kick. However, it's ultimately Bruno Fernandes who takes it, curling a tame effort well over the crossbar.
HALF TIME: PORTUGAL 0-0 FRANCE
50th min: Mbappe tests Costa with a stinging drive, before a quick Portugal counter ends when Mendes goes down inside the France box. Referee Michael Oliver is not interested, as the left-back seemed to dive and there was no contact from Upamecano.
55th min: Taking the ball in the face, causing his protective mask to jar against his broken nose, Mbappe is left down hurt on the turf.
57th min: After some medical attention, the French public release a collective sigh of relief: Mbappe is cleared to continue.
59th min: Camavinga makes a crucial last-ditch tackle to deny Rafael Leao a chance to shoot from close range.
61st min: Left exposed, Maignan saves from Bruno Fernandes in a one-on-one! Joao Cancelo fires over the top soon after.
63rd min: Living up to his nickname, 'Magic Mike', France's number one now defies Vitinha, who misses a gilt-edged chance to break the deadlock from close range!
66th min: Kolo Muani is clean through after a brilliant build-up, but Ruben Dias makes a crucial late intervention to deflect the striker's goalbound shot just wide of the far post!
71st min: Camavinga collects the ball inside Portugal's area, following a favourable deflection, but his angled shot flies just wide of the far post!
75th min: Substitute Ousmane Dembele curls a wonderful shot from the right side of the box only centimetres over the top of the crossbar.
80th min: Palhinha goes into the referee's book for a strong challenge on Mbappe, resulting in a suspension that would see him miss a potential semi-final.
84th min: William Saliba brings down Francisco Conceicao and picks up a booking. Ronaldo then strikes the 25-yard free kick straight into the French defensive wall.
88th min: In the centre of his goal, Costa comfortably fields a low scuffed shot by Kante, which was hit more in hope than expectation of scoring.
89th min: Kante repeats his ambitious attempt of a few moments before, but with the same result: Costa easily saves it.
91st min: An important block by Saliba at one end is quickly followed by 41-year-old Pepe defying his age to race back and make a vital tackle inside the Portuguese box!
FULL TIME IN NORMAL TIME: PORTUGAL 0-0 FRANCE
93rd min: Conceicao slips past Hernandez and drives into the area, pulling the ball back towards the unmarked Ronaldo. The veteran striker hits it first time, but his shot is dismally off target.
97th min: Substitute Marcus Thuram fires well wide, following another Pepe block - this time to deny Mbappe.
102 min: Rafael Leao sees the goal briefly open up in front of him, but the Portugal winger has his shot charged down at close range.
HALF TIME IN EXTRA TIME: PORTUGAL 0-0 FRANCE
106 min: Having hurt his injured nose again earlier, France captain Mbappe finally succumbs. He's replaced by former PSG teammate Bradley Barcola.
108 min: Just off the bench, Joao Felix arrives unmarked at the back post, only to head a great close-range chance into the side-netting!
112 min: Dembele storms inside from the right, then unleashes a rising strike high over the crossbar from 20 yards out.
114 min: After beating Semedo and teeing up a shot, Barcola fires off target with the latest wayward French goal attempt.
120 min: Nuno Mendes races away on the counter, releasing Bernardo Silva on the right; after receiving a return pass, the full-back scuffs a tame shot straight at Maignan.
FULL TIME: PORTUGAL 0-0 FRANCE (France win 5-3 on penalties)
MAN OF THE MATCH - Pepe
Despite Portugal's elimination - and his subsequent tears while being consoled by fellow veteran Ronaldo - Pepe put in another virtuoso display of age-defying defending.
Making several crucial blocks and partnering seamlessly with Ruben Dias, the 41-year-old did enough to steer the Selecao to within a shootout of the semi-finals, but his journey ends here.
Surely he will step aside for fresh talent at the heart of the Portuguese defence - though it remains to be seen whether Ronaldo will follow him through the exit door.
STANDOUT MOMENT
After a game played out between two talented teams clearly wearied by their efforts so far this summer - and throughout last season - the most memorable moment was perhaps to be seen following the final whistle.
Though Ruben Dias made a top-class block to deny Kolo Muani, then Theo Hernandez coolly scored France's spot-kick winner, two Portuguese legends were captured by the cameras when the action finally ended.
Left to comfort each other following the Selecao's heartbreaking exit, Pepe and Ronaldo - both age-related record breakers at these finals - will be forever entwined in their nations' sporting history: and this emotional image may be revisited again and again.
BEST STAT
MATCH STATS
Possession: Portugal 60% - 40% France
Shots: Portugal 15 - 4 France
Shots on target: Portugal 20 - 5 France
Corners: Portugal 11 - 4 France
Fouls: Portugal 8 - 13 France
LINEUPS
PORTUGAL (4-2-3-1): Costa; Cancelo, Dias, Pepe, Mendes; Palhinha, Vitinha; B. Silva, Fernandes, Leao; Ronaldo
FRANCE (4-3-1-2): Maignan; Kounde, Saliba, Upamecano, T. Hernandez; Kante, Tchouameni, Camavinga; Griezmann; Mbappe, Kolo Muani