After the game finished 0-0 following extra time, Joao Felix hit a post with a penalty in the shootout and Theo Hernández converted the clinching kick.
Portugal head coach Roberto Martinez consoles Cristiano Ronaldo after the quarterfinal loss. (EPA PHOTO)
Portugal had the best chances to take the win during regular time, forcing goalkeeper Mike Maignan into two big saves to deny Bruno Fernandes in the 61st minute and then Vitinha in the 63rd.
But the 0-0 stalemate persisted after extra time and the Portuguese side were faced with a second consecutive shootout, following a 3-0 win on penalties against Slovenia in the last 16.
The victory ended Kylian Mbappé's and France's heartbreak in shootouts, having lost in them at their last two major tournaments - in the last 16 at the Euros in 2021 and in the 2022 World Cup final.
Mbappé didn't even take a penalty in the shootout, having been substituted after the first half of extra time following a couple of knocks to his broken nose that was covered by a protective mask.
"It wasn't easy," France goalkeeper Mike Maignan said. "We didn't always play that great, it was a complicated game. We played well defensively."
"We got to the penalty shootout and didn't waver. We can be proud of ourselves."
Didier Deschamps' team has reached the semifinals despite no France player having scored from open play so far in the tournament.
The 39-year-old Ronaldo has said this was his record sixth and last European Championship.
France will play Spain in the semifinals after their extra-time win over Germany in Stuttgart earlier.