Using hybrid functional calculations, we investigate the effects of defects and defect complexes related with Cd, Li, and N impurities on the atomic and electronic properties of Ag3PO4. It was found that substitutional Cd on Ag lattice site (CdAg) contributes to the n-type conductivity of Ag3PO4. For substitutional Cd on P (or O) lattice site (CdP) (or CdO), it is not expected that Cd will incorporate into the P (or O) site due to the strong covalent interactions in the PO4 structural units. The interstitial Cd (Cdi) acts as a shallow donor, but its formation energy is relatively high compared with that of CdAg. For the (CdAg-2NO) complex, the formation of this inactive complex generates a fully occupied impurity band just above the valence band maximum of Ag3PO4, which significantly reduces the acceptor transition energy level. But the formation energy of the (CdAg-2NO) complex is even higher than that of the corresponding single point defect NO. Unlike LiP and LiO which has relatively high formation energy, interstitial Li (Lii or Lii(s)) with an appreciable solubility is likely to be the n-type dopant under O-poor condition.