Experimental evidence suggests that the folding and aggregation of the amyloid beta-protein (Abeta) into oligomers is a key pathogenetic event in Alzheimer's disease. Inhibiting the pathologic folding and oligomerization of Abeta could be effective in the prevention and treatment of Alzheimer's disease. Here, using all-atom molecular dynamics simulations in explicit solvent, we probe the initial stages of folding of a decapeptide segment of Abeta, Abeta(21-30), shown experimentally to nucleate the folding process. In addition, we examine the folding of a homologous decapeptide containing an amino acid substitution linked to hereditary cerebral hemorrhage with amyloidosis-Dutch type, [Gln-22]Abeta(21-30). We find that: (i) when the decapeptide is in water, hydrophobic interactions and transient salt bridges between Lys-28 and either Glu-22 or Asp-23 are important in the formation of a loop in the Val-24-Lys-28 region of the wild-type decapeptide; (ii) in the presence of salt ions, salt bridges play a more prominent role in the stabilization of the loop; (iii) in water with a reduced density, the decapeptide forms a helix, indicating the sensitivity of folding to different aqueous environments; and (iv) the "Dutch" peptide in water, in contrast to the wild-type peptide, fails to form a long-lived Val-24-Lys-28 loop, suggesting that loop stability is a critical factor in determining whether Abeta folds into pathologic structures.