We investigate the effect of phosphorus doping on the atomic structure of B-related defects in crystalline Si through first-principles pseudopotential calculations. We find that a B-P complex is the most stable defect, with a binding energy of about 0.3 eV, compared with isolated B and P ions. When Si self-interstitials (I-s) are generated by ion implantation, B and P dopants form an I-s-B-P complex. The stability of the I-s-B-P complex is greatly enhanced as the Fermi level increases, compared with the I-s-B complex. The formation of the B-P and I-s-B-P complexes is suggested to be responsible for the suppression of B diffusion in Si predoped with donor impurities. (C) 2003 Elsevier B.V. All rights reserved.