Although cognitive interventions for obsessive-compulsive disorder (OCD) have been tested in randomized trials, there are few trials that have tested the specific mechanisms of cognitive interventions, i.e. how they achieve their effects. In this study, we aimed to investigate the mediating effects of a short cognitive intervention in the treatment of OCD and used data from a recently conducted randomized controlled trial where 101 participants were allocated to either Internet-based CBT (ICBT) or to a control condition. Obsessive beliefs were measured at pre-treatment, at the time they had received the cognitive intervention, and also at post-treatment. Weekly OCD symptoms were measured throughout the 10 weeks of treatment. We hypothesized that (1) the ICBT group would have greater reductions in obsessive beliefs (controlling for change in OCD symptoms) after completing the cognitive intervention, and that (2) this reduction would, in turn, predict greater OCD symptom reduction throughout the rest of the treatment period. Contrary to our expectations, the longitudinal mediation analysis indicated that (1) being randomized to ICBT actually increased the degree of obsessive beliefs after receiving the cognitive intervention at weeks 1-3, and (2) increase in obsessive beliefs predicted better outcome later in treatment. However, when repeating the analysis using cross-sectional data at post-treatment, the results were in line with the initial hypotheses. Results were replicated when the control condition received ICBT. We conclude that, although obsessive beliefs were significantly reduced at post-treatment for the ICBT group, early increase rather than decrease in obsessive beliefs predicted favourable outcome. Copyright (C) 2014 John Wiley & Sons, Ltd.