The major histocompatibility complex (MHC) has repeatedly been found to influence mate choice of vertebrates, with MHC-dissimilar mates typically being preferred over MHC-similar mates. We used horses (Equus caballus) to test whether MHC matching also affects male investment into ejaculates after short exposure to a female. Semen characteristics varied much among stallions. Controlling for this variance with a full-factorial within-subject experimental design, we found that a short exposure to an MHC-dissimilar mare enhanced male plasma testosterone and led to ejaculates with elevated sperm numbers as compared to exposure to an MHC-similar mare. Sperm velocity seemed not affected by the treatment. Overall genetic similarity between stallions and mares (determined from polymorphic microsatellites on 20 different chromosomes) played no significant role here. The MHC type of the teaser mare also affected characteristics of cold-stored sperm after 24 and 48 hr. As expected from ejaculate economics, sperm viability was elevated after exposure to an MHC-dissimilar mare. However, oxidative stress and the percentage of sperm with a high DNA fragmentation were mostly increased after exposure to an MHC-dissimilar mare, depending also on whether the teaser mare was in oestrous or not. We conclude that males can quickly adjust ejaculate quality relative to a female's MHC, and that this male reaction to the social environment can also affect important characteristics of cold-stored semen.