THE recent discoveries1-4 of massive planetary companions orbiting several solar-type stars pose a conundrum. Conventional models5,6 for the formation of giant planets (such as Jupiter and Saturn) place such objects at distances of several astronomical units from the parent star, whereas all but one of the new objects are on orbits well inside 1 AU; these planets must therefore have originated at larger distances and subsequently migrated inwards. One suggested migration mechanism invokes tidal interactions between the planet and the evolving circumstellar disk7. Such a mechanism results in planets with small, essentially circular orbits, which appears to be the case for many of the new planets. But two of the objects have substantial orbital eccentricities, which are difficult to reconcile with a tidal-linkage model. Here we describe an alternative model for planetary migration that can account for these large orbital eccentricities. If a system of three or more giant planets form about a star, their orbits may become unstable as they gain mass by accreting gas from the circumstellar disk; subsequent gravitational encounters among these planets can eject one from the system while placing the others into highly eccentric orbits both closer and farther from the star.