The mountain pine beetle (Dendroctonus ponderosae Hopkins, Coleoptera: Curculionidae, Scolytinae) is a native insect of the pine forests of western North America, and its populations periodically erupt into large-scale outbreaks. During outbreaks, the resulting widespread tree mortality reduces forest carbon uptake and increases future emissions from the decay of killed trees. The impacts of insects on forest carbon dynamics, however, are generally ignored in large-scale modelling analyses. The current outbreak in British Columbia, Canada, is an order of magnitude larger in area and severity than all previous recorded outbreaks. Here we estimate that the cumulative impact of the beetle outbreak in the affected region during 2000-2020 will be 270megatonnes (Mt) carbon (or 36gcarbonm-2yr-1 on average over 374,000km2 of forest). This impact converted the forest from a small net carbon sink to a large net carbon source both during and immediately after the outbreak. In the worst year, the impacts resulting from the beetle outbreak in British Columbia were equivalent to ~75% of the average annual direct forest fire emissions from all of Canada during 1959-1999. The resulting reduction in net primary production was of similar magnitude to increases observed during the 1980s and 1990s as a result of global change. Climate change has contributed to the unprecedented extent and severity of this outbreak. Insect outbreaks such as this represent an important mechanism by which climate change may undermine the ability of northern forests to take up and store atmospheric carbon, and such impacts should be accounted for in large-scale modelling analyses.