Occupational exposure to endotoxin in organic dust may induce lung function decline. Microsomal epoxide hydrolase (mEH) detoxifies reactive oxygen species generated by endotoxin exposure, and polymorphisms of the mEH gene are associated with altered enzyme activity. We investigated the associations between mEH polymorphisms, endotoxin exposure, and lung function decline in a 20-year prospective study of 265 workers exposed to endotoxin and 234 control subjects. mEH Tyr113His and His139Arg polymorphisms were genotyped by the 5' nuclease assay, and data were analyzed using multivariate linear regression models, adjusting for important covariates. Overall, the annual decline rate of FEV1 was 29.47 ml during the 20-year follow-up. Endotoxin exposure was associated with faster lung function decline among genotypes associated with slower enzyme activity: estimates (SE) of annual FEV1 decline rates for endotoxin exposure were -2.33 (2.07), -2.81 (1.66), and -6.73 (2.83) ml for Tyr/Tyr, Tyr/His, and His/His genotype groups, respectively, for the Tyr113His polymorphism; and -1.82 (2.58) and -4.27 (1.33) ml for Arg/Arg + His/Arg and His/His genotypes, respectively, for the His139Arg polymorphism. We conclude that mEH polymorphisms modify the association between occupational endotoxin exposure and longitudinal lung function decline.