We study the effects of the impressive growth in electrification in Brazil between 1960 and 2000 on changes in the structure of rural agricultural production, including adoption of irrigation, increases in agricultural productivity and investments, changes in land use, and the allocation of effort between crop cultivation and cattle grazing. The instrumental variables based identification strategy simulates a time series of hypothetical electricity grids that show how the grid would have evolved had hydro-power dams (which require intercepting water at high velocity) been allocated solely on geography-based cost considerations. Electrification allows farmers to irrigate, which leads to higher productivity, especially in areas with volatile rainfall patterns. Farming expands into frontier lands, and cultivation intensifies in existing land through investments in mechanization, fertilizer and pesticides. Crop intensification and substitution away from land-intensive cattle grazing lead to greater protection of forests and native vegetation within farms. Expansion of agriculture and this substitution have opposing effects on forest protection, and overall we estimate a net decrease in deforestation associated with electrification.