A drift-diffusion model for spin-charge transport in spin-polarized p-n junctions is developed and solved numerically for a realistic set of material parameters based on GaAs. It is demonstrated that spin polarization can be injected through the depletion layer by both minority and majority carriers, making all semiconductor devices such as spin-polarized solar cells and bipolar transistors feasible. Spin-polarized p-n junctions allow for spin-polarized current generation, spin amplification, voltage control of spin polarization, and a significant extension of spin diffusion range. DOI: 10.1103/PhysRevB.64.121201 PACS number͑s͒: 72.25.Dc, 72.25.Fe, 85.75.Ϫd Spintronics 1,2 has played an important role in defining applications that are either not feasible or ineffective with traditional semiconductor electronics. Spintronic devices have found their niche in industries for magnetic read heads and nonvolatile memory cells. Here we propose and demonstrate a scheme for spintronics, a spin-polarized p-n junction, 2 which amplifies spin density, significantly extends the range of spin diffusion, electronically tailors spin polarization, and, in combination with light as a spin-polarized solar cell, generates spin-polarized currents with tunable spin polarization. We prove these concepts by solving drift-diffusion equations for a realistic device model based on GaAs, which demonstrates that spin polarization can be injected through the depletion layer. Possibility of injecting spin polarization through a transistor is also discussed.The electrical injection of spin-polarized carriers within all-semiconductor structures ͑from a magnetic into a nonmagnetic semiconductor͒ was recently realized experimentally 2 ͑the scheme proposed in Ref. 3͒. Optical injection of spin-polarized carriers ͑both minority 4,5 and majority 4,6 ͒ has been known for some time. In addition, the relatively long spin diffusion lengths, 6,7 coherent spin transport across semiconductor interfaces, a successful fabrication of a magnetic/nonmagnetic p-n junction 8 based on the ͑Ga,Mn͒As material, 9 and the recent demonstration of a gatevoltage control of magnetization in ͑In,Mn͒As, 10 make semiconductors promising materials for spintronic applications. 2 In this paper we investigate the spin-charge transport in semiconductors under the conditions of inhomogeneous bipolar doping ͑there also exist theoretical proposals for semiconductor unipolar transistors and diodes 12 -a very different case from ours͒; we are not concerned with spin injection per se. Our model device is a spin-polarized p-n junction with spin polarization induced ͑either optically-in which case we get a spin-polarized solar cell-or electronically͒ to minority or majority carriers. By studying spin-charge transport numerically across the depletion layer, we observe phenomena, all resulting from the fact that spin polarization is transferred ͑what we call injected͒ through the depletion layer.We introduce a drift-diffusion model for spin-charge transport in an inhomogeneously-doped s...