Doppler spectroscopy has detected 152 planets around nearby stars. A major puzzle is why many of their orbits are highly eccentric; all planets in our Solar System are on nearly circular orbits, as is expected if they formed by accretion processes in a protostellar disk. Several mechanisms have been proposed to generate large eccentricities after planet formation, but so far there has been little observational evidence to support any particular model. Here we report that the current orbital configuration of the three giant planets around upsilon Andromedae (υ And) probably results from a close dynamical interaction with another planet, now lost from the system. The planets started on nearly circular orbits, but chaotic evolution caused the outer planet (υ And d) to be perturbed suddenly into a higher-eccentricity orbit. The coupled evolution of the system then causes slow periodic variations in the eccentricity of the middle planet (υ And c). Indeed, we show that υ And c periodically returns to a very nearly circular state every 6,700 years.