It is largely unknown how South America's Andean forests affect the global carbon cycle, and thus regulate climate change. Here, we measure aboveground carbon dynamics over the past two decades in 119 monitoring plots spanning a range of >3000 m elevation across the subtropical and tropical Andes. Our results show that Andean forests act as strong sinks for aboveground carbon (0.67 ± 0.08 Mg C ha-1 y-1) and have a high potential to serve as future carbon refuges. Aboveground carbon dynamics of Andean forests are driven by abiotic and biotic factors, such as climate and size-dependent mortality of trees. The increasing aboveground carbon stocks offset the estimated C emissions due to deforestation between 2003 and 2014, resulting in a net total uptake of 0.027 Pg C y-1. Reducing deforestation will increase Andean aboveground carbon stocks, facilitate upward species migrations, and allow for recovery of biomass losses due to climate change.