 On 2 July 2017, in the third-place match against Mexico at the 2017 FIFA Confederations Cup, Pepe scored an injury time equalizer to send the match into extra-time.Portugal eventually won the match 2–1 to capture the bronze medal.In Portugal's opening match against Spain, Pepe went down after a collision with Spain forward Diego Costa, who then took the ball into the penalty area before scoring.