We have analysed the hydration of main-chain carbonyl and amide groups in 24 high-resolution well-refined protein structures as a function of the secondary structure in which these polar groups occur. We find that main-chain atoms in beta-sheets are as hydrated as those in alpha-helices, with most interactions involving "free" amide and carbonyl groups that do not participate in secondary structure hydrogen bonds. The distributions of water molecules around these non-bonded carbonyl groups reflect specific steric interactions due to the local secondary structure. Approximately 20% and 4%, respectively of bonded carbonyl and amide groups interact with solvent. These include interactions with carbonyl groups on the exposed faces of alpha-helices that have been correlated previously with bending of the helix. Water molecules interacting with alpha-helices occur mainly at the amino and carbonyl termini of the helices, in which case the solvent sites maintain the hydrogen bonding by bridging between residues i and i-3 or i-4 at the amino terminus and between i and i+3 or i+4 at the carbonyl terminus. We also see a number of solvent-mediated Ncap and Ccap interactions. The water molecules interacting with beta-sheets occur mainly at the edges, in which case they extend the sheet structure, or at the ends of strands, in which case they extend the beta-ladder. In summary, the solvent networks appear to extend the hydrogen-bonding structure of the secondary structures. In beta-turns, which usually occur at the surface of a protein, exposed amide and carbonyl groups are often hydrated, especially close to glycine residues. Occasionally water molecules form a bridge between residues i and i+3 in the turn and this may provide extra stabilization.