Oort cloud comets are currently believed to have formed in the Sun's protoplanetary disk and to have been ejected to large heliocentric orbits by the giant planets. Detailed models of this process fail to reproduce all of the available observational constraints, however. In particular, the Oort cloud appears to be substantially more populous than the models predict. Here we present numerical simulations that show that the Sun captured comets from other stars while it was in its birth cluster. Our results imply that a substantial fraction of the Oort cloud comets, perhaps exceeding 90%, are from the protoplanetary disks of other stars.