In 2002, Caspi and colleagues provided the first epidemiological evidence that genotype may moderate individuals' responses to environmental determinants. However, in a correlational study great care must be taken to ensure the proper estimation of the causal relationship. Here, a randomized experiment was performed to test the hypothesis that the MAOA gene promoter polymorphism (MAOA-LPR) interacts with environmental adversity in determining aggressive behavior using laboratory analogs of real-life conditions. A sample of 57 Caucasian male students of Catalan and Spanish origin was recruited at the University of Barcelona. Ostracism, or social exclusion, was induced as environmental adversity using the Cyberball software. Laboratory aggression was assessed with the Point Subtraction Aggression Paradigm (PSAP), which was used as an analog of antisocial behavior. We also measured aggressiveness by means of the reduced version of the Aggression Questionnaire. The MAOA-LPR polymorphism showed a significant effect on the number of aggressive responses in the PSAP (F1,53 = 4.63, P = 0.03, partial η2 = 0.08), as well as social exclusion (F1,53 = 8.03, P = 0.01, partial η2 = 0.13). Most notably, however, we found that the MAOA-LPR polymorphism interacts significantly with social exclusion in order to provoke aggressive behavior (F1,53 = 4.42, P = 0.04, partial η2 = 0.08), remarkably, the low-activity allele of the MAOA-LPR polymorphism carriers in the ostracized group show significantly higher aggression scores than the rest. Our results support the notion that gene–environment interactions can be successfully reproduced within a laboratory using analogs and an appropriate design. We provide guidelines to test gene–environment interactions hypotheses under controlled, experimental settings.