THE recent discovery1 and confirmation2 of a possible planetary companion orbiting the solar-type star 51 Pegasi represent a breakthrough in the search for extrasolar planetary systems. Analysis of systematic variations in the velocity of the star indicate that the mass of the companion is approximately that of Jupiter, and that it is travelling in a nearly circular orbit at a distance from the star of 0.05 AU (about seven stellar radii). Here we show that, if the companion is indeed a gas-giant planet, it is extremely unlikely to have formed at its present location. We suggest instead that the planet probably formed by gradual accretion of solids and capture of gas at a much larger distance from the star (~5 AU), and that it subsequently migrated inwards through interactions with the remnants of the circumstellar disk. The planet's migration may have stopped in its present orbit as a result of tidal interactions with the star, or through truncation of the inner circumstellar disk by the stellar magnetosphere.