One of the major goals of pharmacogenetics is to elucidate mechanisms and identify patients at increased risk of adverse events (AEs). To date, however, there have been only a few successful examples of this type of approach. In this paper, we describe a retrospective case-control pharmacogenetic study of an AE of unknown mechanism, characterized by elevated levels of serum alanine aminotransferase (ALAT) during long-term treatment with the oral direct thrombin inhibitor ximelagatran. The study was based on 74 cases and 130 treated controls and included both a genome-wide tag single nucleotide polymorphism and large-scale candidate gene analysis. A strong genetic association between elevated ALAT and the MHC alleles DRB1*07 and DQA1*02 was discovered and replicated, suggesting a possible immune pathogenesis. Consistent with this hypothesis, immunological studies suggest that ximelagatran may have the ability to act as a contact sensitizer, and hence be able to stimulate an adaptive immune response.