Substitute Eder struck in the second half of extra time to secure victory, with Portugal having to play the majority of the match without injured captain Cristiano Ronaldo on Sunday.
France came into the game as the tournament's top scorers and boasted the leading marksman in Antoine Griezmann.
But Pepe and defensive partner Jose Fonte kept a dangerous France front line limited for the most part, although Griezmann wasted a gilt-edged headed chance and Andre-Pierre Gignac hit the post in second-half stoppage time.
Pepe's 12 clearances were more than any team-mate, while he also led the team with three blocks. Only left-back Raphael Guerreiro (6) racked up more clearances than the Real Madrid defender's five.