A game played in sweaty conditions at the end of a blisteringly hot day in Philadelphia was decided by two goals in first-half stoppage time.