To assess the efficacy of continuous extrapleural intercostal nerve block on postoperative pain and pulmonary function, a prospective, randomized, double-blind, placebo-controlled trial was conducted on 56 patients undergoing elective thoracotomy. Infusion was started before closing the chest and was continued for 5 days. Subjective pain relief was assessed on a linear visual analogue scale. Pulmonary function was measured on the day before operation and daily for 5 days. There were 29 patients in a group which received bupivacaine and 27 in a control group which received saline. The bupivacaine group had lower pain scores (P less than 0.01) and required less papaveretum (P less than 0.01) than the control group. Forced vital capacity, forced expiratory volume in 1 s and peak expiratory flow rate were maximally reduced at 24 h to median values of 56, 60 and 57 per cent, respectively, of preoperative control values in the bupivacaine group, and to 25, 30 and 32 per cent in the control group. These differences are highly significant (P less than 0.01). Restoration of pulmonary function was superior in the bupivacaine group (P less than 0.01). There were no infusion-related complications. After thoracotomy, continuous intercostal blockade with bupivacaine is a safe and effective method of pain relief which reduces the early loss of postoperative pulmonary function significantly and more rapidly restores respiratory mechanics.