Gödel's second incompleteness theorem is generalized by showing that any ön+1-definable and ön-sound extension of Peano arithmetic (PA) cannot prove its own ön-soundness. The optimality of the generalization is shown by presenting a ön+1-definable and ön-1-sound extension of PA that proves its own ön-1-soundness.