Among resource-rich countries, the United States has the highest rate of child mortality by unintentional firearm use. To test whether children's exposure to violent video games increases dangerous behavior around firearms. This randomized clinical trial was set in a university laboratory and included pairs of children aged 8 to 12 years who knew each other. Of 313 participants who signed up, 250 were tested (2 arrived without partners, 61 did not arrive to participate). Of the 250 children tested, 8 were excluded (2 did not complete the study, 2 had participated in a related study, and 4 were outliers). Each child was paid $25. Data were collected July 1, 2017, to July 31, 2018. In a 3-group randomized design, pairs of children played or watched 1 of 3 versions of the game Minecraft for 20 minutes: (1) violent with guns, (2) violent with swords, or (3) nonviolent. The pairs of children were then placed in a different room and were told they could play with toys and games for 20 minutes. A cabinet in the room contained 2 hidden disabled handguns with counters for trigger pulls. Play sessions were videotaped. Main outcomes were touching a handgun, seconds spent holding a handgun, and number of trigger pulls (including at oneself or the partner). Control variables included sex, age, trait aggressiveness, exposure to violent media, attitudes toward guns, presence of firearms in the home, interest in firearms, and whether the child had taken a firearm safety course. Of 242 participants, 220 children (mean [SD] age, 9.9 [1.4] years; 129 [58.6%] boys) found a gun and were included in analysis. Among the 76 children who played the video game that included gun violence, 47 children (61.8%) touched a handgun. Among the 74 children who played the video game that included sword violence, 42 (56.8%) touched a handgun. Among the 70 children who played the nonviolent video game, 31 (44.3%) touched a handgun. Participants who played a violent version of the game were more likely to shoot at themselves or their partners than those who played a nonviolent game. Other risk factors for dangerous behavior around firearms included self-reported habitual exposure to violent media and trait aggressiveness. Self-reported exposure to violent media was positively associated with total trigger pulls (incidence rate ratio [IRR], 1.40; 95% CI, 1.00-1.98) and trigger pulls at oneself or one's partner (IRR, 1.88; 95% CI, 1.29-2.72). Trait aggression was positively associated with total trigger pulls (IRR, 13.52; 95% CI, 3.14-58.29), trigger pulls at oneself or one's partner (IRR, 25.69; 95% CI, 5.92-111.39), and time spent holding a handgun (IRR, 4.22; 95% CI, 1.62-11.02). One protective factor was having taken a firearm safety training course. Exposure to violent video games increases children's dangerous behavior around firearms. ClinicalTrials.gov identifier NCT03259139.