How is prenatal sex selective behaviour influenced by the presence of cheap fetal gender identification technology and financial incentives? We analyze a conditional cash transfer program in India called Janani Suraksha Yojna. By providing access to prenatal sex detection technology like the ultrasound scans, and simultaneously providing cash incentives to both households and community health workers for every live birth, this program altered existing trends in prenatal sex selection. Using difference-in-differences and triple difference estimators we find that the policy led to an increase in female births. This improvement comes at a cost, as we observe an increase in under 5 mortality for girls born at higher birth orders, indicating a shift in discrimination against girls from pre-natal to post-natal. Our calculations show that the net effect of the policy was that nearly 300,000 more girls survived in treatment households between 2006 and 2015. Finally, we find that the role played by community health workers in facilitating the program is a key driver of the decline in prenatal sex selection.