According to previous studies oxycodone might have some advantages over morphine in the treatment of visceral pain. This study investigated the opioid consumption (primary outcome), pain relief and side effects (secondary outcomes) of morphine versus oxycodone after percutaneous nephrolithotomy using a method where the somatic pain component was minimized. Forty-four adult patients were studied. The patients were randomised to receive either morphine or oxycodone intravenously as postoperative pain treatment. During the first 4 h after surgery the opioid consumption, pain scores and side effects (nausea, dizziness, sedation, respiratory effects and itching) were registered. The postoperative opioid consumption varied considerably between the patients but the mean opioid consumption in the morphine and oxycodone group was comparable (18.93 mg versus 16.15 mg, P = 0.7). Nausea was significantly less frequent with morphine (P = 0.03). In this study morphine and oxycodone produced similar analgesia the first 4 h after surgery but the frequency of nausea was significantly less patient-reported with morphine. The hypothesis that oxycodone would be superior in the treatment of visceral pain after percutaneous kidney stone operation was not confirmed.