Increasing agricultural productivity can have ambiguous effects on forest protection in theory: it can expand the scope of farming, which is detrimental to the forest, but it can also induce farmers to intensify their production. The authors examine these predictions using county-level data from five waves of the Brazilian Census of Agriculture. The authors identify productivity shocks using the expansion of rural electrification in Brazil during 1960-2000. The authors show that electrification increased crop productivity, and farmers subsequently both expand farming through frontier land conversion, but also shift away from land-intensive activities and into capital- and labor-intensive activities. The net effect depends on the county’s land use prior to the increase in agricultural productivity, but it reduces deforestation in the typical county in the sample.