Comorbid psychological problems are commonly related to chronic pain but addressing heterogeneous comorbidities in traditional settings is often difficult. Delivering individually tailored treatment using the internet could be a viable alternative. The present study investigates whether a guided, individually tailored and internet-delivered cognitive behavioral therapy (ICBT) could improve mood and reduce disability in individuals suffering from chronic pain and comorbid psychological distress. Participants were recruited from a pain clinic and randomized to either ICBT or waiting list. The participants (n = 187) individually tailored treatments included 6-13 modules targeting different types of psychological distress. Modules were designed to be completed weekly, and feedback was provided by clinicians. Participants completed an average of 5.1 (49.7%) modules, with 22.9% completing all assigned modules. Intention-to-treat analyses showed significantly larger improvements in depression, disability, pain acceptance, catastrophizing, and quality of life in the ICBT-group compared to the control group. Between-group effect sizes were very small or small at post for the primary outcomes depression (d = 0.18) and pain interference (d = 0.22). Other effect sizes ranged from very small to small, with the largest effect being improvements in pain acceptance (d = 0.3). All significant changes were stable at 12-month follow up. Funding Agencies|Uppsala University; AFA Insurance