Direct and mixing-induced CP-violating asymmetries in Bs -> K+K- decays are measured for the first time using a data sample of pp collisions, corresponding to an integrated luminosity of 1.0 fb^{-1}, collected with the LHCb detector at a centre-of-mass energy of 7 TeV. The results are C_{KK} = 0.14 pm 0.11 pm 0.03 and S_{KK} = 0.30 pm 0.12 pm 0.04, where the first uncertainties are statistical and the second systematic. The corresponding quantities are also determined for B0 -> pi+pi- decays to be C_{pipi} = -0.38 pm 0.15 pm 0.02 and S_{pipi} = -0.71 pm 0.13 pm 0.02, in good agreement with existing measurements.