Let (M, g) be a smooth compact Riemannian manifold without boundary of dimension n ≥ 6. We prove thatThe inequality is sharp in the sense that on any (M, g), K can not be replaced by any smaller number and Rg can not be replaced by any continuous function which is smaller than Rg at some point. If (M, g) is not locally conformally flat, the exponent 2n/(n + 2) can not be replaced by any smaller number. If (M, g) is locally conformally flat, a stronger inequality, with 2n/(n + 2) replaced by 1, holds in all dimensions n ≥ 3. key words: sharp Sobolev inequality, critical exponent, Yamabe problem MSC 2000 subject classification: 35J60, 58E35