We construct the explicit solution of the initial value problem for sequences generated by the general Somos-6 recurrence relation, in terms of the Kleinian sigmafunction of genus two. For each sequence there is an associated genus two curve X, such that iteration of the recurrence corresponds to translation by a fixed vector in the Jacobian of X. The construction is based on a Lax pair with a spectral curve S of genus four admitting an involution σ with two fixed points, and the Jacobian of X arises as the Prym variety Prym(S, σ).