We examine the impact of improved access to electricity on deforestation through the incentives it creates for farms to switch from cattle grazing to croplands. We generate a model that elucidates the conditions under which increases in agricultural productivity can increase the incentives to intensify rather than expand land use and 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 estimate the impact of rural electrification in Brazil from 1960 to 2000 and the resulting increases in agricultural productivity. We show that locations suitable for hydropower generation experienced improvements in crop yields incentivizing credit-constrained farmers to shift away from land-intensive cattle grazing and into cropping. As a result, agricultural land use declined, more native vegetation was protected, and these effects persist 25 years later in both census and satellite data.