Abstract The doping characteristics of direct-gap bulk n-Al x Ga 1− x As doped with Si and grown by molecular-beam epitaxy are determined by the coexistence of shallow and deep donors, both of which are caused by Si-impurities. The deep donor is ionized thermally at high temperatures and optically at low temperatures, resulting in a persistent increase of the free carrier concentration. The persistent photoconductivity in selectively n-doped n-Al x Ga 1− x As/GaAs heterostructures is predominantly caused by the photoionization of the deep Si-donor in the Al x Ga 1− x As layer. Electron-hole generation in the GaAs contributes only a minor part to persistent photoconductivity in n-type heterostructures. In p-type heterostructures, however, electron-hole generation is the dominant mechanism responsible for persistent photoconductivity and contributes 5 × 10 10 holes per cm 2 for a 1 μm thick GaAs buffer layer to the two-dimensional electron- (hole-) gas. The hole concentration in selectively p-type heterostructures is calculated versus (i) Al-mole fraction, (ii) acceptor concentration in the p-Al x Ga 1− x As, and (iii) Al x Ga 1− x As spacer width. Theoretical hole concentrations agree well with experimental data, if the bandgap difference of GaAs and Al x Ga 1− x As is taken to be distributed by a ratio of if 75 25 to the conduction- and valence-band discontinuity. Hall measurements on selectively p-doped Al x Ga 1− x As/GaAs heterostructures reveal a freeze-out of carriers and high hole mobilities at low temperatures. The acceptor binding energy in the p = Al x Ga 1− x As:Be is determined to be E a = 26 ± 3 meV for x = 0.45.