Many interesting materials phenomena such as the emergence of high-Tc superconductivity in the cuprates and colossal magnetoresistance in the manganites arise out of a doping-driven competition between energetically similar ground states. Doped multiferroics present a tantalizing evolution of this generic concept of phase competition. Here, we present the observation of an electronic conductor-insulator transition by control of band-filling in the model antiferromagnetic ferroelectric BiFeO 3 through Ca doping. Application of electric field enables us to control and manipulate this electronic transition to the extent that a p-n junction can be created, erased and inverted in this material. A dome-like feature in the doping dependence of the ferroelectric transition is observed around a Ca concentration of 1/8, where a new pseudo-tetragonal phase appears and the electric modulation of conduction is optimized. Possible mechanisms for the observed effects are discussed on the basis of the interplay of ionic and electronic conduction. This observation opens the door to merging magnetoelectrics and magnetoelectronics at room temperature by combining electronic conduction with electric and magnetic degrees of freedom already present in the multiferroic BiFeO 3.