The transition in barnase from the native state to a compact globule has been studied with high-temperature molecular dynamics simulations. A partial destruction of the alpha-helices and the outer strands of the beta-sheet is observed with water molecules replacing the hydrogen bonds of the secondary structural elements. Simultaneously, the main alpha-helix moves away from the beta-sheet and exposes the principal hydrophobic core, many of whose nonpolar side chains, beginning with the ones near the surface, become solvated by hydrogen-bonded water molecules. This step involves a significant increase in the solvent-exposed surface area; the resulting loss of stability due to the hydrophobic effect may be the major source of the activation barrier in the unfolding reaction. The detailed mechanism described here for the first stage of the denaturation of barnase, including the essential role of water molecules, is likely to be representative of protein denaturation, in general.