BACKGROUND: Several recent studies suggest that repetitive transcranial magnetic stimulation can temporarily reduce pain perception in neuropathic pain patients and in healthy adults using laboratory pain models. No studies have investigated the effects of prefrontal cortex stimulation using transcranial magnetic stimulation on postoperative pain. METHODS: Twenty gastric bypass surgery patients were randomly assigned to receive 20 min of either active or sham left prefrontal repetitive transcranial magnetic stimulation immediately after surgery. Patient-controlled analgesia pump use was tracked, and patients also rated pain and mood twice per day using visual analog scales. RESULTS: Groups were similar at baseline in terms of body mass index, age, mood ratings, pain ratings, surgery duration, time under anesthesia, and surgical anesthesia methods. Significant effects were observed for surgery type (open vs. laparoscopic) and condition (active vs. sham transcranial magnetic stimulation) on the cumulative amount of patient-delivered morphine during the 44 h after surgery. Active prefrontal repetitive transcranial magnetic stimulation was associated with a 40% reduction in total morphine use compared with sham during the 44 h after surgery. The effect seemed to be most prominent during the first 24 h after cortical stimulation delivery. No effects were observed for repetitive transcranial magnetic stimulation on mood ratings. CONCLUSIONS: A single session of postoperative prefrontal repetitive transcranial magnetic stimulation was associated with a reduction in patient-controlled analgesia pump use in gastric bypass surgery patients. This is important because the risks associated with postoperative morphine use are high, especially among obese patients who frequently have obstructive sleep apnea, right ventricular dysfunction, and pulmonary hypertension. These preliminary findings suggest a potential new noninvasive method for managing postoperative morphine use.