More than 90 irregular moons of the Jovian planets have recently been discovered. These moons are an enigmatic part of the solar system inventory. Their origin, which is intimately linked with the origin of the planets themselves, has yet to be adequately explained. Here we investigate the possibility that the irregular moons were captured from the circumsolar planetesimal disk by three-body gravitational reactions. These reactions may have been a frequent occurrence during the time when the outer planets migrated within the planetesimal disk. We propose a new model for the origin of irregular satellites in which these objects are captured from the planetesimal disk during encounters between the outer planets themselves in the model for outer planet migration advocated by Tsiganis and collaborators. Through a series of numerical simulations we show that nearby planetesimals can be deflected into planet-bound orbits during close encounters between planets, and that the overall efficiency of this capture process is large enough to produce populations of observed irregular satellites at Saturn, Uranus, and Neptune. The orbits of captured objects are broadly similar to those of known distant satellites. Jupiter, which typically does not have close encounters with other planets in the model of Tsiganis and coworkers, must have acquired its irregular satellites by a different mechanism. Alternatively, the migration model should be modified to accommodate Jupiter's encounters. Moreover, we find that the original size-frequency distribution of the irregular moons must have significantly evolved by collisions to produce their present populations. Our new model may also provide a plausible explanation for the origin of Neptune's large moon Triton.