Triton is Neptune's principal satellite and is by far the largest retrograde satellite in the Solar System (its mass is approximately 40 per cent greater than that of Pluto). Its inclined and circular orbit lies between a group of small inner prograde satellites and a number of exterior irregular satellites with both prograde and retrograde orbits. This unusual configuration has led to the belief that Triton originally orbited the Sun before being captured in orbit around Neptune. Existing models for its capture, however, all have significant bottlenecks that make their effectiveness doubtful. Here we report that a three-body gravitational encounter between a binary system (of approximately 10(3)-kilometre-sized bodies) and Neptune is a far more likely explanation for Triton's capture. Our model predicts that Triton was once a member of a binary with a range of plausible characteristics, including ones similar to the Pluto-Charon pair.