The result means Saints have not won in their last eight Premier League outings, while Leeds move above Arsenal into 10th position on the table.
Bamford opened the scoring two minutes after half-time when he was slipped in by Tyler Roberts.
Asked about his side's stunning second-half, Leeds boss Marcelo Bielsa said: "In the second half, having been able to score so quickly, it opens up the game.
"The difference of three goals is bigger than the difference in the performance between the two teams. We had to put in a big effort to not allow them to dominate and dominate in the moments which we did.
"Even if our offensive game was good, because we managed to create double the chances than the opponent, the transmit of the game were alternate."