Fomalhaut, a bright star 7.7 parsecs (25 light-years) from Earth, harbors a belt of cold dust with a structure consistent with gravitational sculpting by an orbiting planet. Here, we present optical observations of an exoplanet candidate, Fomalhaut b. Fomalhaut b lies about 119 astronomical units (AU) from the star and 18 AU of the dust belt, matching predictions of its location. Hubble Space Telescope observations separated by 1.73 years reveal counterclockwise orbital motion. Dynamical models of the interaction between the planet and the belt indicate that the planet’s mass is at most three times that of Jupiter; a higher mass would lead to gravitational disruption of the belt, matching predictions of its location. The flux detected at 0.8 μm is also consistent with that of a planet with mass no greater than a few times that of Jupiter. The brightness at 0.6 μm and the lack of detection at longer wavelengths suggest that the detected flux may include starlight reflected off a circumplanetary disk, with dimension comparable to the orbits of the Galilean satellites. We also observe variability of unknown origin at 0.6 μm.