Forests play a critical role in mitigating climate change, and, at the same time, are predicted to experience large-scale impacts of climate change that will affect the efficiency of forests in mitigation efforts. Projections of future carbon sequestration potential typically do not account for the changing economic costs of timber and agricultural production and land use change. We integrated a dynamic forward-looking economic optimization model of global land use with results from a dynamic global vegetation model and meta-analysis of climate impacts on crop yields to project future carbon sequestration in forests. We find that the direct impacts of climate change on forests, represented by changes in dieback and forest growth, and indirect effects due to lost crop productivity, together result in a net gain of 17 Gt C in aboveground forest carbon storage from 2000 to 2100. Increases in climate-driven forest growth rates will result in an 81-99% reduction in costs of reaching a range of global forest carbon stock targets in 2100, while the increases in dieback rates are projected to raise the costs by 57-132%. When combined, these two direct impacts are expected to reduce the global costs of climate change mitigation in forests by more than 70%. Inclusion of the third, indirect impact of climate change on forests through reduction in crop yields, and the resulting expansion of cropland, raises the costs by 11-38% and widens the uncertainty range. While we cannot rule out the possibility of climate change increasing mitigation costs, the central outcomes of the simultaneous impacts of climate change on forests and agriculture are 64-86% reductions in the mitigation costs. Overall, the results suggest that concerns about climate driven dieback in forests should not inhibit the ambitions of policy makers in expanding forest-based climate solutions.