Development programs have been increasingly used not only as an instrument for economic and political development, but also as a tool for counterinsurgency. Using a large-scale randomized field experiment we test this approach by examining the effect of the largest development program in Afghanistan. We find that the introduction of this program leads to significant improvement in villagers’ economic wellbeing as well as in their attitudes towards government. The program also leads to an improved security situation in the long run. These positive effects on attitudes and security, however, are not observed in districts with high levels of initial violence.