When agricultural productivity improves, farmers may react by expanding farming and further encroach on forest lands, or they may choose to intensify their production and produce more output with less land. We specify the conditions under which agricultural productivity can have such ambiguous effects on deforestation. We then examine the predictions of that model using county-level data from five waves of the Brazilian Census of Agriculture and satellite-based measures of land use. We identify productivity shocks using exogenous variation in rural electrification in Brazil during 1960-2000. We show that locations suitable for hydropower generation experienced improvements in crop yields and that credit-constrained farmers subsequently shifted away from land intensive cattle-grazing and into cropping. As a result, agricultural land use declines, and this effect persists 25 years later in both census and satellite data. Brazil’s deforestation rate would have been almost twice as large between 1970 and 2000 without that increase in agricultural productivity. That makes the conservation benefits of productivity improvements comparable to the most prominent conservation packages ever implemented in Brazil.