The Kuiper belt extends from the orbit of Neptune at 30 AU to an abrupt outer edge about 50 AU from the Sun. Beyond the edge is a sparse population of objects with large orbital eccentricities. Neptune shapes the dynamics of most Kuiper belt objects, but the recently discovered planet 2003 VB12 (Sedna) has an eccentric orbit with a perihelion distance of 70 AU, far beyond Neptune's gravitational influence. Although influences from passing stars could have created the Kuiper belt's outer edge and could have scattered objects into large, eccentric orbits, no model currently explains the properties of Sedna. Here we show that a passing star probably scattered Sedna from the Kuiper belt into its observed orbit. The likelihood that a planet at 60-80 AU can be scattered into Sedna's orbit is about 50 per cent; this estimate depends critically on the geometry of the fly-by. Even more interesting is the ~10 per cent chance that Sedna was captured from the outer disk of the passing star. Most captures have very high inclination orbits; detection of such objects would confirm the presence of extrasolar planets in our own Solar System.