Diabetes mellitus is a frequent underlying comorbidity in patients with Staphylococcus aureus endocarditis, and it represents a risk factor for complications and a negative outcome. The pathogenesis of staphylococcal endocardial infections in diabetic hosts has been poorly characterized, and little is known about S. aureus gene expression in endocardial vegetations. We utilized a rat model of experimental S. aureus endocarditis to compare the pathogenesis of staphylococcal infection in diabetic and nondiabetic hosts and to study the global S. aureus transcriptome in endocardial vegetations in vivo. Diabetic rats had higher levels of bacteremia and larger endocardial vegetations than nondiabetic control animals. Microarray analyses revealed that 61 S. aureus genes were upregulated in diabetic rats, and the majority of these bacterial genes were involved in amino acid and carbohydrate metabolism. When bacterial gene expression in vivo (diabetic or nondiabetic endocardial vegetations) was compared to in vitro growth conditions, higher in vivo expression of genes encoding toxins and proteases was observed. Additionally, genes involved in the production of adhesins, capsular polysaccharide, and siderophores, as well as in amino acid and carbohydrate transport and metabolism, were upregulated in endocardial vegetations. To test the contribution of selected upregulated genes to the pathogenesis of staphylococcal endocarditis, isogenic deletion mutants were utilized. A mutant defective in production of the siderophore staphyloferrin B was attenuated in the endocarditis model, whereas the virulence of a surface adhesin (ΔsdrCDE) mutant was similar to that of the parental S. aureus strain. Our results emphasize the relevance of diabetes mellitus as a risk factor for infectious endocarditis and provide a basis for understanding gene expression during staphylococcal infections in vivo.