We report the electrochemical synthesis of iron phosphide films used as anodes of lithium secondary batteries. The phosphorus content in the film was increased to a level almost equal to that of Fe (corresponding to a FeP y composition with 0.85< y <0.91) through the selective electrochemical dissolution of Fe and Fe-rich phase from the electroplated film. The as-deposited film exhibited a dense structure characterised by numerous submicron-sized nodules in contact with each other, and maintained its overall mechanical integrity even after the selective dissolution. The as-deposited and the selectively etched films with high P content were tested as anodes of lithium secondary batteries. The performance of the selectively etched films far exceeded that of the as-prepared films. In particular, a 500-nm-thick film maintained a reversible discharge capacity greater than 420mAhg−1 after 30 cycles. No specific physical damage was observed in the film after the cycling tests.