Manny Longelo's first goal for West Ham United at Under-23 level inspired the club's first Premier League International Cup win as a 2-1 victory over Porto left the cup-holders' defence under threat.
The 17-year-old was played through down the right to slot in the opener on 28 minutes.
Gleison Moreira headed in an equaliser for Porto, who have won the International Cup the past two seasons, with 22 minutes left.
But Jahmal Hector-Ingram's powerful strike with three minutes remaining gave West Ham three points, taking them to within one of Group A leaders Southampton with a match in hand.
Porto, having played two matches, have one point with one fixture remaining. With West Ham and Southampton to meet, Porto cannot win the section and are struggling to reach the knockout stages as one of the two best runners-up in the group stages.
See: West Ham blog